Reworked tests to work with either 'python test.py' or using nosetests