Functions for caching a matrix inverse

Wrote the functions for inverting a non-singular matrix and caching the
inverse.