Add tests and fix bugs found.
0.1.0