Various utilities for dealing with bit arrays