Fix silly bug
Get rid of code duplication
Speed up some slow tests
Merge pull request #338 from ayg/ayg/range-speed-fix

Make Range tests run faster; r=zcorpan