Factor out batch indexing logic into a ChangeBatchIndexer

Change-Id: Ief166fadc61f76a5f4ffdb879322e9883040bdd6
11 files changed