switched to using unittest.TestCase
tweaking tests
merged jeremy's pull request