Moved out database and logging
Unit tests passing
Refactored out into lots of assemblies. Seems neater.
Everything public for now though, make internal before first release.