Register derived types into the base type, and don't clean them up as unused.
Inheritance between complex types now uses proper C++ inheritance.

One still can't pass a derived class where a base class was expected, though.