Inheritance between complex types now uses proper C++ inheritance.

One still can't pass a derived class where a base class was expected, though.
(cherry picked from commit 436780703ecba718e97d4abba7197127d257b870)
The inheritance changes are in 1.3 after all.