After each test, remove any stray nodes added to the document

This was not necessary when we were running each test in its own `<iframe>`, and it doesn't seem to affect any test behavior currently, but it seems wise for the sake of test isolation and hygiene.