Fix version locking in cache
Fixes to event store based on hints from Darren
Adding more unit tests to locking inmemory cache