Mostly done with #20. A little more unit test coverage would do good.