Have it working with tests

- Should think a little bit about the API names.
- Also need to change the cmd arguments