Ported some methods including add_model_object() and apply_config() to XS