Moves db and config into libs