Adds support for NSCountResultType

It's not super efficient; I think in the case of fetch requests with no predicate, you could optimize by avoiding loading the object data.