add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
This should be equivalent to the 'BufferDuration' that is currently used by the influxDB driver.