Update connection handling to be compatible with modern socket.io.

This fix #16.