Implemented functions makeCacheMatrix and cacheSolver.