Code to create matrix object and solve/cache inverse.