Move backend related socket handlers from app.js