Added functions for cacheable matrix inverting

This is a group of functions for computing once and caching the inverse
of a matrix rather than compute it repeatedly