Execution order of externally loaded scripts

(bug 637264)