Reuse global d3's document for xhr test.
Refactor svg tests using smash.