Add data object caching. Closes #238.

Implemented a data object cache, which is used by the models to speed up loading of data by first using the cache and only then loading from the database. Closes #238.