Some hacks to fix tests.
Removed lots of unused code
Tests now must be run with nosetests