Add a context serializer for the messaging

Change-Id: I30e5d4d65abb90705977d74c75b8335573a30abb