Fix diag and its code style.

This commit fixes `diag` to correctly call `_diag_mapper` instead of
`diag_mapper.` Diag no longer raises a NameError on `diag_mapper.`

This also ensures two blank lines precede _diag_mapper and diag and
updates the docstrings to the new style.
Add dimension check for diagonal

In diagonal, ensure the array has at least two dimensions and raise
ValueError if not (following NumPy's conventions). Update return type
in docstring to be ShuffleExpr (what it's always returned).
Merge pull request #167 from rgardner/fix-diag

Fix diag and diagonal.