Extended the DomDocument constructor to turn off errors and register itself as an extension.