Refactored command line to use yargs and moved logic out of binary

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