[irc] Migrate IRC queries to support sets in Python

This facilitates the creation of new queries and allows
to have more than one filter in each analysis.