Clean up tests

Removed boilerplate code to run from command line as nosetests does not
require this.