Update cachematrix.R

Update cachematrix.R to cache a given matrix and to cache its inverse.