Update safeRange to account for backwards ranges.

Also update type signature to take just Range<Int> not Array<Range<Int>>