Messed with an idea to use List<BitSet>, then changed mind. Implemented a few functions.
Add tests and helper functions; fix bug in translateIndices.