Refactored command line to use yargs.

Fixes #7

- Moved logic to libs and nothing in the binary
- Some refactoring
- The same set of tests that were passing before still pass now