Refactor history module and extend it's data model

This changes the data model we are using for each stored item in the history based on feedback from @indeox and @stephanfowler to abstract it slightly for their needs.

It also adds a new metaData key to the JS page config object of keywordIds.

Unit tests slightly re-factored also to add coverage for new use cases.