Add tests

We would like to get better test coverage, and this is a start.