Moving the methods for loading files from scriptmain to toolmain (pull up) then using in climain, cgimain and the obsolete main.