add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
I see. I think UI does not specify any percentiles by default, i.e. query.CpuUsagePercentiles and query.MemoryUsagePercentiles are all empty slices. If so, then we could check if MemoryUsagePercentiles and CpuUsagePercentiles are empty at  manager/manager.go:141 and only call Percentiles() when any of them is not empty.