Add a message-received API

And use to implement an echo in __main__