BitSet performance optimizations and tests.