Refactor store.

* Use DataResolver and EntityResolver to resolve data_mappings and entity_mappings.
* Use EntityReference instead of Hash to manage entity_references.