[JENKINS-20280] Make it easy to change the implementation. Especially Map.Entry is not so convenient to handle.
[JENKINS-20280] Use topological sorting to decide the order to override variables.
Merge pull request #993 from ikedam/feature/JENKINS-20280_TopologicalSort

[JENKINS-20280] Decide variable overriding order with topological sorting