Added code to cachematrix.R

Code to perform functions as described in the assignment has been added
to cachematrix.R