Added topological sorting of dependencies before building the response string.
Merge pull request #35 from smallmultiples/topological-dependencies

Added topological sorting of dependencies before building the response string