n-dimensional weighted mean

Previously we could only compute the weighted mean for matrices, but with this PR we can compute the weighted mean for arbitrary dimensions of arbitrary ND arrays. For reductions across the first and last dimension I use matrix multiplication after reshaping. (This algorithm is restricted to Arrays, since the `vec` and `reshape` methods may not be implemented or may return a copy for other types.) For reductions across middle dimensions or AbstractArrays I use Cartesian. (Is there way to do this using BLAS, besides iterated calls to `gemv`?)