CLI Cleanup

This refactors the CLI entry points into a single place, adds basic test coverage for execution, and refactors some of the other methods into more appropriately named places.