Initial rewrite of chat filtering