Added test framework
Moved some things around, added a test