Added topological sorting of dependencies before building the response string

Just used the tsort package from npm for the actual logic of it. Once you've built your list of required polyfills from dependencies and aliases, make sure everything is in order before writing the response.