Client-server architecture

This change reworks the Mocket API to more closely match the real Socket.IO API.
Perhaps check that the socket is passed as an argument as well.