Stabilize application start() semantics

This adds a test that the app will accept WebSocket connections as soon as startup completes, so that the other tests can run in an environment with fewer random failures.  This test turned up multiple races, which this patch also fixed.

It adds a pending test, which, once implemented and related server-side bugs as well as the afterEach hook are fixed in response, should remove some shutdown races.

It also renames one test, which incorrectly labeled what it was testing.

Most, but not all, of this patch was cherry-picked from the cleanup PR I submitted yesterday.  But this PR is a bunch smaller.