[Mosaic] Add support for (almost) arbitrary reductions
This significantly generalizes the support for reduction ops.
Reductions can now be performed over dimensions that are not tiled, and
can even be performed on multiple dimensions at the same time (which in
general ends up being more efficient than doing them one at a time).
PiperOrigin-RevId: 576853033