Update [[Unregister]] and [[HandleDocumentUnload]] by defining [[ClearRegistration]]