Moved many matrix functions to matrix base class at the (extremely, extremely minor) expense of speed