Clean up a little and write a tester.

TODO: Test the tester.