Add linear topological-sort with include-leaves?

I tried transients out, and they only yielded a small performance gain. If it turns out to be desirable, I'd be happy to do that, though. Let me know how it works.