Cleaned up a lot in the code. Pushed the first tests.