Added some tests

Tests should cover at least the majority of the code.