Implemented a simple caching for the Inverse of a Matrix.