Cleanup and testing.

Adds to #4.