Keyvaluestore cache

Mainly add header cache to KeyValueStore, in order to make header passed with shared_ptr, there exists many methods arguments needed to change.
Hmm, it's an unordered map, but the order is likely to be stable between iterations (except for removed or added items).  I think you want to remember where you left off last time and continue on from there.  Otherwise, you'll tend to constantly go over the first items in the iteration order.