[MRM-1264] Only create the DefaultIndexingContext once for a scan to reduce the amount of garbage collection. Also move optimization to end of scan to increase performance.