TypeFinder: prefer iterative algorithm to keep stack usage low.

Introduce subtype_reverse_iterator to maintain
the numbering assigned during the recursive type walk.