fix stability of spd matrix generation
move *naryOp to *naryExpr and cleanup headers
add scalar() call to cast 1x1 matrix to Scalar