Move db to helpers, fix caching of collections and models