Fix slowness of maximum & minimum along dimensions

maximum and minimum along dimensions call ``reducedim`` using ``scalarmax`` and ``scalarmin``. That these two statements did not change following the latest update causes at least 10x slow-down for ``maximum(x, d)`` and ``minimum(x, d)``.