Implements an arbitrary-length bitfield. The implementation and interface is similar to and derived from bitflags.