Add tests. Obviously, they could use some cleanup and more robustness.