Change order of searches to save memory

Changing TypeWithDict::byName() to search for classes and enumerations first saves memory, because it reduces run-time header parsing.
Please merge this request as soon as convenient.