Client-server architecture

This change reworks the Mocket API to more closely match the real Socket.IO API.
I suppose middleware configuration is more thoroughly tested below.