Make web socket handlers more robust to bad code by registering them

Make web socket handlers more robust to bad code by registering them
when the worker starts, so that if they crash, they get restarted and
reregistered.