Completed cachematrix.R

My submission for R Programming Assignment 2.