CMS-953 Create initial framework for indexing content

Refactoring, added tests