moment function

New generic for moments of matrix distributions