Removed dead code
Added a lot of unit tests and fixed some bugs along the way