Refactor query to get list of tags and the number of posts they are in