Add extra debugging information.
When `window.close()` is called, we should just ask the compositor to exit
normally.

The old code made the mistake of attempting to shutdown the associated
pipelines itself, which caused race conditions with the constellation and
compositor, as they expect to be able to drain their message queues
before exiting.
Changes the Constellation shutdown procedure to a message and response
from the Compositor instead of a message with an immediate callback.

The problem was that the old model introduced a potential deadlock. If
the Constellation had a pending RenderReadyMsg in its queue when the
ExitMsg arrived from the Compositor, the Compositor would exit its
message loop and wait for the response from the Constellation. But,
the Constellation would send a SetIds message to the Compositor, which
also required a response - resulting in deadlock.
Also handle the exit after load and output file cases for ref tests
auto merge of #1500 : larsbergstrom/servo/content_fixup, r=metajack

r? @metajack
Implement Node::replaceChild()

Implements Node:replaceChild() according to spec below:
http://dom.spec.whatwg.org/#concept-node-replace

Closes #1430.
auto merge of #1504 : brunoabinader/servo/node-replace-child, r=Ms2ger

Implements Node:replaceChild() according to spec below:
http://dom.spec.whatwg.org/#concept-node-replace

Closes #1430.