Cleaned up sockets.js, minor renaming.