asynctypes-685526: jsdom fixes

The GCLI tests now complete cleanly under jsdom. Jsdom is useful for
command line testing, but the environment is too buggy to be worth much
effort. I'm close to ripping it out but right now I'm just commenting
out tests that don't pass.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Allow testing with PhantomJS

In theory testing with PhantomJS should be better than JSDom because the
former is a headless webkit rather than a JS emulation. Certainly so
far there are way less exclusions. The one downside is that is can't be
run from Node.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Handle promise failures from keyUp

The DOM event handler Inputter.onKeyUp returned a promise to help with
testing, but when it was registered to a DOM event handler we were just
throwing failures on the ground. This ensures that we don't drop these
failures.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Minor testing tidy-ups

Remove double semi-colon, use builtin binding of forEach rather than
Funciton.bind, and check for existence of 'pref list' command more
correctly.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Bring back stati.pass/fail

It's correct that conflating 'are we finished' with the failure count is
poor, but it's what the UI is expecting and rather than re-engineer the
UI, we're just going to get it working for now.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: Be defensive about removed nodes

When we're asynchronous, nodes can be removed from the tree before we
get to them, so we should be defensive about this when processing the
template.

Signed-off-by: Joe Walker <jwalker@mozilla.com>
asynctypes-685526: assert.log should be assert.skip

assert.log was only being used to note when tests were skipped [1], and
the messages were conflating the results, so call it assert.skip and
handle the messages better.

[1] With one exception, for which console.log was better anyway.

Signed-off-by: Joe Walker <jwalker@mozilla.com>