Clean up structure and fix loading of scripts

There was no dependancy in the loading of each
script of the previous one having loaded.