Remove $nin from count() (slooow), bugfixes
Remove $nin from count() (slooow), bugfixes

$nin is way too slow for the count code. It's probably also way too slow
for the other queries.

Also fixed a couple of bugs.
kbase/metrics,kbase/metrics