Support for requiring/importing cross domain scripts minor refactor