Configure server db context

WIP - I dont really want to merge this as I dont believe its a good idea.

Its here just to show what will probably be needed to properly pass around the db..