add support for serialization and deserializations of bits types.