Rewritten RangeSet to use Scala's TreeSet. Still slow.