This patch introduces i_msg_sink and i_msg_source interfaces. This allows us to make message encoder and decoder more general.