add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
How about not releasing the lock here and getting rid of locking from Flush() ?