Add compatibility with socket.io 1.0.0-pre

I'm working with the new socket.io-1.0.0-pre release, and there is no longer an ioSocket object. I tried to make this compatible with the new release and continue compatibility with older versions of socket.io, but admittedly I haven't tested with 0.9.16, only 1.0.0-pre.