Added a "type visitor" function.
This function walks over a type, and calls a closure on every
(newly seen) type. It keeps track of how deeply recursed it is,
and passes this to the closure as well.
Changed HashMap<uint,()> to HashSet<uint> in type_visitor()
Fixed the check on the last commit. (missing !)