Initial implementation of cached matrix inverse.