Fix importOnce variable scope bug.

Without !global the $modules variable is empty on each call, preventing enforcement of the import once rule.