Removed type map matching from VisitDeclaration.

We should only try to find type maps for types, else we can match type maps wrongly if the declaration name happens to have the same name as the one the type map tries to match on.
Fixed invalid declaration name cleaning.

It could happen that by visiting the types of declarations, we'd wrongly reset the unique names counter. In this specific case, this was happening while visiting an event and its parameters.