Fixed #22648 -- Transform.output_type should respect overridden custom_lookup and custom_transform.

Previously, class lookups from the output_type would be used, but any
changes to custom_lookup or custom_transform would be ignored.
Add some more tests for multidimensional arrays.

Also fix slicing as much as it can be fixed.