Dhilton/command line interface

Command line interface from @dhilton with a few superficial changes.