Refactor cuttlefish_util:matches_for_variable_def().