RFC: add function to access diagonal indices

Adds a method `diagind` that constructs a Range object giving the indices of the diagonal elements of a matrix. Also simplifies `diag` and `diagm`.

Addresses part of issue #3158 (see also discussion of #3152).