Code to cache the result of inverting a matrix.