Filling in a more thoughtful ws client listening loop

although I'm still having issues successfully establishing websockets.
Grumble.