Add try/catch around node.ownerDocument.implementation

Fixes Firefox NS_ERROR_UNEXPECTED bug when dynamically adding and removing editors.

This is related to PR #175, which was for the 3.x branch.