Traverse top-down in replaceTypeClassDictionaries, to avoid traversing the wrong part of the AST, for an approx 30% performance improvement when using type classes.