convenience functions and cleanup

Add functions that don't spew BAM onto terminals, and better handling of
the binning mechanism where we modify records.
version numbers and checking for terminal

All utility programs now uniformly check if stdout is a terminal and no
longer dump BAM to the terminal by default.  All those that parse a
command line and most of the remainder have a mechanism to print their
version number now.