Removed some direct output to stderr.
Functions that used to print information directly to stderr now take a
FILE object such that the caller can decide where the information goes.
The caller for now still always prints to stderr, but this reduces the
number of direct references to stderr. Remaining references to stderr in
the selection module are either for 1) part of interactive input, 2)
debug output, or 3) rare error conditions that require some thought on
how to handle.
Related to issue #655.
Change-Id: If0d7b6c5ba36ad64f97ff2cfac8f7ab47b4d5a27