Fix Model.count base implementation and Normalize/validate the query filter

The PR fixes two issues:

1. Fix the count() base implementation using buildWhere() from the sub-class
2. Add logic to normalize/validate the query filter object before delegating to connectors

/to @ritch 
/to @bajtos (We'll need to merge them into the loopback-connector repo).