Updated command line interfaces to be more robust and include additional options. General code cleanup and documentation.