Fixed testing.py so that tests can be run
More fixes for testing

Added config to buildout
Added SQLAlchemy to test-requires
Started work on unittests
Tidy imports
Refactor tests to match earlier refactoring of code