cleaning up core.clj and setting up testing

Starting to re-evaluate the code and write tests for it.