Hoist httpUpgradeHandler out of _configureWebSocketServer to improve modularity/testability
Fix jshint issue
Workaround test warning caused by Sinon not supporting Object.defineProperty