added utility functions for matrix manipulation
several fixes for matrix mode with a Gaussian covariate.  Matrix mode
is basically functional at this point.  Still requires full testing