Move cutting of index data into index code

Alternative fix to gerrit 112750, more performant but more invasive.

Bug: 61066
Change-Id: I1a575c723790fdfea38d5670e7e50b223cdc856c
Merge "Move cutting of index data into index code"