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.
In cases where a Dictionary property had a non-object value type, the
dictionary couldn't be treated like an object. This code will wrap a
dictionary so its non-object values are upcast to objects.