Support exporting ModelType fields with subclassed model instances.

Fixes an issue where exporting a model (either to_native or to_primitive) with ModelType field.  If the value of the field is an instance of a subclass of model class used to instantiate the ModelType, the value is exported as if it was an instance of the base class.

See #184 for a full example.