Allow 'where' argument for scoped count API

Note that the return value will be non-rooted, which is actually what
the
non-scoped /count method returns as well - fixes inconsistency.
Merge pull request #503 from fabien/feature/scope-where

Allow 'where' argument for scoped count API