move reducedim codes from array.jl to reducedim.jl