AJAX collection count

The count queries we do here can be kind of slow, so we make it asynchronous.