Add some unit tests. Lots more to come tomorrow