rand of AbstractArray

This undoes revert of #8309, and re-enables `rand` of long ranges, which was impossible after #8309 (hence the revert).
In this new PR, `rand(typemin(Int):typemax(Int))` remains valid, but there are new possibilities, like e.g. `rand(typemin(Int):1:typemax(Int))`.

It also seems that rand is now slightly faster in some cases (see for example small benchmark in #8563, i.e. `@time for i = 1:10000000; rand(1:4); end`).

The reason I didn't implement this in #8309 is that I don't think I'm the qualified person to introduce the needed functionalities, which is here provided by `cendof` and `cget`: these work like `endof` and `getindex` respectively but with 0-based index (like in C, hence the name; I found the name `cgetindex` too ugly as it has to be used in code, unlike `getindex` which has a nice sugar syntax).
The idea is that currently a range like `r=typemin(Int):typemax(Int)` is such that `r[endof(r)]` raises an `OverflowError`. So we need a (lower-level) way to request the element at any position of such ranges. With the new functions, `cget(r, 0) == typemin(Int)` and `cget(r, cendof(r)) == typemax(Int)` with `cendof(r) == typemax(Uint)`.
I expect this PR to be rejected but hope that in this case someone will implement alternative functions.

cc @ivarne (BTW, I removed the `T` type paramater, cf. your comment https://github.com/JuliaLang/julia/pull/8309#discussion_r17420965).
I don't think `length_0` fits, as whatever the first indice is, the length remains the same, unlike the last indince; I could rename to `endof_0` and `getindex_0` (I first thougth of `length_minus_1` or even `length_1` , taking "_" as meaning "minus", but "end of" describes better what is needed).

I can certainly move the code for `cget/cendof` in random.jl. I didn't do that at first as rand has nothing to do with these implementations (`rand` needs it only not to break previously working functionality), and these could be used elsewhere also (e.g. `sum(1:typemax(Uint))` works but not `sum(0:typemax(Uint))` which should give the same answer, but I admit it's not a very convincing example). However I'd rather not have `rand` have a specialization for ranges.