Compute and cache the inverse of a square matrix

This implementation uses solve function and only supports square matrices.