Simplified the hash-code generation function for CharSet, and it seems to have made a significant performance improvement (probably due to many fewer collisions in HashSet and HashMap).
Made a few other trivial modifications for general clean-up.