This pattern will come up again and again, since we're going to be using Promises heavily.

Please create a function called wait_for_promise_resolved that generalizes this pattern. That function should block until the promise resolves, and should throw an exception if the promise is rejected.

Maybe make the server a global, and create a function called teardownTest which stops it if it's running. teardownTest will automatically be called by Mozmill after each test run.