Extended shiftgrid to arbitrary dimensions.

n-dimensional arrays can be passed to shiftgrid, provided that longitude is the last (right-most) dimension.