This is my final version of the matrix caching functions.  Excessive commentary is provided on how they work.