added support for arrays of BaseRef; added support for nested references; added BaseRef::model() and BaseModel::reference()