Add generalized ufunc linalg functions and make numpy.linalg use them

This is a followup to gh-2954 ([list of new commits](https://github.com/pv/numpy/compare/e7a54da...pv:linalg-gu)), which replaces numpy.linalg routines with the corresponding umath_linalg implementations, while preserving backward compatibility for ndim <= 2 inputs. The new code is all under numpy/linalg.

Numpy's test suite and those of Scipy, Pandas, and Nipy pass with these changes, so there probably aren't obvious problems with backward compat.

This PR doesn't add new functions to numpy.linalg, only replaces existing ones. That, and other things still to do are summarized in issue gh-3217.