Add isEmpty() to the Cache interface.

Used for an upcoming cache backend that does not support size().

Related to #606
Convert InputCache and OutputCache from classes to interfaces.

This simplifies the bindings with different Cache backends.

Related to #606
Start disk based Input/Output cache implementation with MapDB. #606

This stores the cached messages outside of the heap and process in the
file system.
Do not add null messages to the target buffer.
Add TODO about the massive stream/input instance creation.
Add private commit() method and improve logging.
Change some log messages to trace level.
Make clear() atomic and let isEmpty() handle a closed db.
Always check if the db is already closed to avoid errors on shutdown.
Commit and compact the database on startup.
Serialize the message outside of the synchronized block.
Rename config variables and compact on a regular basis.

Database commits get slow once the database gets big.
Update to MapDB 1.0.5.

Fixes some transaction log problems.
Add timer metrics to add, pop, commit and compact methods.
Only compact on startup. Regular compact seems to be flaky for now.
Add message_cache_commit_interval and message_cache_off_heap to config.
Remove hardcoded commit interval and use config value.
Add buildMessageInput() to InputService interface.

This allows the creation of a MessageInput object without initializing
it.
Better background thread name for the DiskJournalCache.
Use DiskJournalCache if message_cache_off_heap is set to true.