Use getopt to parse arguments.
Merge pull request #153 from cgjones/getopt

Use getopt to parse arguments.