Config changes
Lots of database stuff

Needs a lot of playing with design patterns and tidying up. Most of this may end up gone.
Changing ideas for database loading