Topological sorting class and related noded classes, along with unit tests.