Add client-side code for websockets and add message types.

Message types allow dispatch of different payload types to different
receivers.