Implemented cachematrix.R as required by the programming assignment 2 of data science course on coursera.