Use the owner document to create new elements.

Fixes #1533 and avoids “wrong document” error when appending elements to a different document than the one in which D3 was initialized.