Add support for polymorphic deserialization using native type ids: initially needed by YAML module