Fixed the build process to use header and footer for AMD/Common.js support
That also adds order to file loading which allows dependency between files