sorting: various cosmetic code tweaks.
select: our select algorithm was broken, this fixes it [fixes #2103].

This version has various assertions included in comments, which I have
verified to be satisfied. Will remove them next.
select: remove assertion comments.
Merge branch 'master' of github.com:JuliaLang/julia