add support for serialization and deserializations of bits types.
Merge pull request #45 from StefanKarpinski/pull-request/9248c0ae

add support for serialization and deserializations of bits types.