Break up indices() into type-specialized functions

Let Julia do the type checking for us, which is both cleaner and slightly more
efficient. Stop returning ranges when passed a scalar, since we want to
preserve their special behavior (is had no effect anyway).

Support negative integer for vectors too. Convert reals into integers if
possible, so that we can use setdiff() to also support negative values in that
case.