Templatized class for managing a set of sorted non-overlapping integer ranges. Merges and splits ranges as necessary.