attaching a ref of db to the class during a store.  gross hack but functional.  whole thing needs refactoring to just put a ref to the db at the module level I think