fix main-diagonal for ndarray, add test for it, add full PMatrixOps support to ndarray-double and default