Safe serialization of MessageHeaders, using more typedefs, minor cleanups.

Change-Id: I5164d765348ff7e03d1d579c9d3746346855aeaa
Renamed dc::InteractionState to dc::Event, safe serialization of dc::Event, other minor changes

Change-Id: Ib1b2c7ffdbdef2bbeace20aaf24ee15cb2ad8167