updated socket.js
refactored server/app.js