Refactor yaz_match-routines to separate source