Add optional query for Model.all and Model.removeAll

This enables the use of static methods that support queries.