Refactor make init cleaner.
Detect and create a Socket.IO object.