Support for unittest TestCase, small code reorganization
sphinx docs