Add basic unit tests

First two commits ensure all tests pass, third actually adds the tests.