Add linalg.inv()

This PR adds an `'inv` function to the `linalg` module, which calculates the inverse of a matrix (analogous to `numpy.linalg.inv`).