Fix linear indexing for middle-dimension slices; add more tests

This also boosts the speed of linear indexing by about 2-3 fold in my
tests (10^6 elements)
Faster implementation of rand(Range1)
Merge pull request #3779 from lindahua/dh/randrg1

Faster implementation of rand(Range1)
Pkg2: sort available pacakges alphabetically; fix urlpkg regex.
Update to openblas 0.2.7
Revert "Update to openblas 0.2.7"

This reverts commit deb45ea459c23eb8690df414386417d1b5a9d8ad.