AJAX collection count

The count queries we do here can be kind of slow, so we make it asynchronous.
Should likely use the context property rather than this scope hack. http://api.jquery.com/jquery.ajax/ sorry no ID for direct link.