Added CacheService

Extracted all disk caching logic to a CacheService.

Current implementation:
* MapDBCache uses a MapDB database to manage writes to disk.