Implementes a cacheMatrix object with a cacheinverse function as requested.