Use an internal pointer for ownerDocument

This depends on #220

The earlier "solution" was to let `ownerDocument` be invalid when rendering was not valid. This worked quite for a while but eventually, due to usage of template document this became unsustainable. 

Now we use an internal pointer like we do for `parentNode` which we manually keep up to date.

Fixes #216