Unit tests

Yes, there are many.