added Model::query method.
Merge branch '4.0'