Finish implementation of cachematrix.R