Add Resource::resourceId().

Also add default constructors to Model::Index and Model::Primitive.