Add Tests

Adds tests. Increases test coverage from 30% to 70% :smile_cat: 
Great changes overall. Can you run the code formatter on this file too? It's easier to change spacing now and keep it consistent than to fix it later.