Simplify the command line output
Use getopt_long for option parsing

The syntax is much more forgiving now. The reason we're using
getopt_long and not simply getopt is that getopt_long can reorder
argv, which allows us to maintain backwards compatibility.
Update the manual page with option -h
Only output errors to stderr
Use the static keyword where appropriate
Check if stdout is a terminal

We shouldn't write control codes to anything other than a terminal.