A C++ class for dealing with bit fields