Some cleanup. Begin unit tests.