add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
Ideally we just need to know the precision and we can derive the number of stats: bufferDuration/precision. Precision  will be manager.HousekeepingTick. I am OK with a TODO for now.