Make EmitReduce use indexing maps
Make EmitReduce use indexing maps

All index calculation are now performed by the new indexing maps
which makes the implementation of `EmitReduce` quite a bit simpler.
