Added caching, and started work on DB storage code