Add filter parameter to various resource count functions.

Many resources support passing filters when returning a count.