Improved support for deriving from a model in which a derived model is
contained.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>