Add Tests

Adds tests. Increases test coverage from 30% to 70% :smile_cat: 
For consistency's sake, can you run the code formatter on this file? The previous style has a space between `for` and the opening parenthesis (`for(` => `for (`) as well as between the closing parenthesis and the curly (`){` => `) {`).