Major Refactor/Reorganization

Moves a lot of functionality out of cli and into their own classes, as well as general cleanup.