BitsArray is a convenience structure and functions for manipulating bits as an array instead of using binary masks.