Hsearch 882 final

NOT TO BE MERGED YET

Freshly rebased, needs to be applied of the IndexManager contract changes to compile