Add BaseModel::count() method