Use a more semantically correct check to see if the websocket was correctly
upgraded.
Fix tests.
pep8 goodness