Updated client.js to reflect async encoding

See detailed log in socket.io-protocol commit:
3e561290ce393c01b087de7340162268caf36f0f

Changed the encode function so that it uses a callback.