Calculate and store matrix inverse in cache

The following functions return the inverse of a matrix.
The functions will calculate the inverse of matrix and store the result
in the cache. If the inverse of the same matrix is called again, the
function will not recalculate it again, but will retrieve the stored
result from the cache.