whereis: rewrite most of the command

The earlier code gave little or no change to fix bugs and improve the
command.  This rewrite attempts to make further patching easier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>
whereis: add search scope listing option

Mostly useful when debugging why the command does, or does not, work.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
whereis: align with howto-usage-function.txt

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
whereis: support MANPATH environment variable

The MANPATH has been around long enough that it can be added to whereis
default search path.

Reference: manpath(1)
Addresses: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
docs: generic whereis.1 clean up

Align with howto-man-page.txt, and more importantly remove out dated 'SEE
ALSO' and 'BUGS' sections.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>