Speed optimizations in derivationsOfClass and inherits_from_class.