In CharSet methods, check for inverted range instead of passing the range directly to the CharDiet functions; this avoids the possibility of creating a tree with inverted intervals.
Removed AvlTree.Split as it's not used anywhere.
Minor optimizations, e.g., to reuse CharSets when they're not modified by some operation.
Moved the implementations of the CharDiet.toSeq, .toList, .toArray, and .toSet functions into the corresponding CharSet methods.
Added null-check preconditions to all methods in CharSet.