Adjust tsort to sort items at the same level

tsort will now sort items at the same topological level by name.  This means
that dependencies will come out in a well defined order, despite the order
they are listed.