Refactoring db into /models, using config json for db