Deprecate old icky database stuff, Add new repository base class