Upcast Dictionary Improvements

I wanted to improve the predictability and the efficiency of the latest
UpcastDictionary code. I switched to a breadth-first search of
sub-types, filtering out duplicates.