Set the document global variable when the ElementDocumentWrapper is created

Useful to access the document using a global variable named "document"