Implement the HeaderStore.

Complete most of the functionality of the HeaderStore.