moved db cache to env and added reverse keys tests