Implement wrapping of document.register
Wrap lifecycle callbacks
Merge pull request #199 from arv/document-register-callbacks

Implement document.register lifecycle callbacks