Better support for subclassing.

Several classes are looked up dynamically.