Matrix cache and inverse (solve) functions implemented.