better test framework + minor bug fixes in KeyValueStore