infer: Use a topological sort to always infer stack effects correctly.

Recursive and cyclic words are still not handled correctly. I don't know if
there's a good way to do it, period.
infer: Make stuff compile again.