Applies fn to each subclass of class. If proper? is true, then the class itself is not included in the mapping. Proper? defaults to nil.