I would like to do something like this:
myNamespace.io = io;
delete io;
This doesn't work, because Socket.IO references the global io internally. There are different ways how to solve this. I think the easiest solution would be to put a var io = this.io at the beginning of every file. References to io would then hit the local copy instead of the global io. That's also the way jQuery does it.