Assignment2 Function to get inverted matrix from cache or otherwise, to invert matrix.