conditionals for compatibility with other versions

Specifically, older versions of julia which didn't have UniformScaling and older (newer?) versions of StatsBase which don't have range defined.
Merge pull request #91 from StefanKarpinski/patch-1

conditionals for compatibility with other versions