changed how key-value indexing is done, test for db.clj