Caching the Inverse of a Matrix

This function calculates the inverse of a matrix and fetches it from
cache in case it is already calculated for that data earlier.