Added option to send messages via json or dump into stdout.