Add listen() helper to manage messages where there's a type property that can be used to route messages.