Reorder functions in match.h to group pure/non-pure ones