Implemented some structure-sharing optimizations for HashSet.