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.