Move websocket server starting code from init() to run()