Use count query to perform paging.

Large collections would cause PHP memory issues, as we tried to load an entire collection into memory to get the count, before being sliced...

...  Will probably want to look at the other batches in the future, as they will try to query with a deprecated method if they are called without any children. Fixed the delete one, as it gets called in the tests.