var document = realwindow.document

log(document); //[object DeadObject]
var document = realwindow.document;
log(document);  //HTMLDocument

Redefining document revitalizes the document object. Now working on
isDocAlive() and keepAlive() functions to make sure the document is
alive and give it CPR when needed.