Removed MySQL limit on querying tags

MySQL puts a limit on how large a query can be. For queries with 100k +
tags, it errored out. So this change breaks the queries down into 10k
tags at a time.