First draft of cachematrix.R