Revert "Undo sorting types by inheritance until we figure out what's up with Sage."

This reverts commit 12d7dbb301851508af7950fbb4307a1d5b2af615.