Refactor command line tool

- Combine spec files
- Pull out lots of methods so the cli tool is more readable