Rather than always create a Global scope and then immediately add a Module child node, we now set the kind of the root scope to global (for scripts) or module (for modules) based on the program node.