Complete functions for inversing a square matrix

Update the template with actual code to cache the inverse of matrix.