Merge scriptloader changes into 1.3.2-wip

Merging in the scriptloader branch into 1.3.2-wip.