Extract DOM manipulation functions into their own ns
Include unresolved state queue as part of the environment