Added code for cachematrix.R

Added code for functions in cachematrix.R.