Improve internal data structure

- [x] rewrite data structure to decrease memory usage and allow faster set operations
- [x] remove `.remove(fn)` as it won’t be needed anymore (it was only there to provide better performance, which will soon be available at all times anyway)
- [ ] rewrite `createCharacterClasses` to make use of the new data structure
- [ ] rewrite `difference` to make use of the new data structure
- [ ] rewrite `intersection` to make use of the new data structure
- [ ] deprecate non-chaining APIs?
- [ ] optimization: replace calls to `array.splice(a, b, c)` where `b=1` with just `array[a] = c` (and similar for other argument counts)