Reduce complexity in bosh_server.js