Report exceptions to JS when the DOM implementation fails.

As a bonus, adds some debugging statements.
Add test.
auto merge of #1304 : Ms2ger/servo/exceptions, r=jdm

As a bonus, adds some debugging statements.

This is better than the status-quo–uncatchable exceptions–but we should also implement `DOMException` soonish.