Added TestDatabaseModule so tests can specify their own DB configuration. The modules are currently too tightly coupled - see whether any dependencies can be removed.