reorder javascript loads so that polyfills only run if needed