Refactoring and tidying up of various different parts of the codebase.

Let pylint guide the way!
Add unittests for the report handlers.

Add a useful base class for implementing any unittest.
Merge pull request #47 from TheTorProject/fix/refactoring

Fix/refactoring