Add command line parsing functionality.
Merge branch 'cmdline'