Add new tests and cleanup a bit.

Depends on your definition of cleanup.