Fix sortperm for ranges (#2160)
I have updated the sort doc a bit so that things are consistent,
but it needs a comprehensive update based on Stefan's recent work.
Merge branch 'master' of github.com:JuliaLang/julia