Final version of cachematrix.R for Assignment 2 of R Programming Course
Calculates (and caches) the inverse of a matrix