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.