Upgraded all scripts.
Corrected all scripts that were loading incorrectly and tidied up some of the code.