[BZ 1135629] add paging for index queries

This is the initial commit for IndexIterator. It encapsulates the logic for
paging with index queries. It also takes care of going through all partitions
in the index for a given date range.