web & hub: exchange encode/decode
web: allow websocket, TODO
web: implement message protocal for ws

Javascript code:
    ws.send(JSON.stringify([__instruction__, JSON.stringify(__message__)]));
hub: fix doctest