add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
This cache works in Per-container level. i.e. for each container, it maintains maxNumStatsInCache stats and maxNumSamplesInCache samples. whereas dirtyStats maintains stats within bufferDuration. But yes, it is actually duplicated.