Rewrite the tests from using plain 'assert' mixed with some nosetests
methods to the standard unittest module layout. Improve the code
to use the most canonical assertion methods whenever possible.
This has a few major advantages:
- the code uses standard methods now, resulting in a reduced number of WTFs whenever someone with basic Python knowledge gets to read it,
- completely unnecessary dependency on nosetests is removed since the standard library supplies all that is necessary for the tests to run,
- the tests can be run via any test runner, including the one built-in in Python,
- the failure output for most of the tests is improved from 'assertion x == y failed' to actually telling the values.