Moved the binning into the 'gather' phase, out of the 'scatter' phase.
Speed-up of approx 5x for half a million files from 10 minutes to 2.