Write some tests

There are currently no tests. :(