Handle websocket connections being lost

This provides initial handling for websocket connections being lost at the user end. Initially we just reset the UI and let the user know that the connection has been dropped. In future, we probably want to think about retrying the connection, or gracefully disconnecting (e.g. keep a call going if we're able to), but they would seem to be separate user stories.

For the tests, calling app.shutdown() doesn't quite work - due to the keep-alive of server connections, and even if we fix those, then selenium doesn't seem to like the server going away before the test is finished, therefore we call the terminate of the websocket, so that we can get to it early and just close that bit down.