Update cachematrix.R

This is my answer to programming assignment 2.  Note the test code at the end.