compression and chunking implementation

This change introduces:
 - compression of cache contents before storing them into MongoDB
 - chunking large content to overcome 16MB BSON limit

Some minor changes include:
 - authentication
 - connection and socket timeout