Implements createCacheMatrix and cacheSolve