added "count" api method to collections and datastore modules. Fixes #239