reorganized the web socket stuff so it's a little more sensible