add (and use) get_match_clause

Just checking... the old queries didn't pin the TypeSystem down at all - does this change performance at all?