Split utils into another file

Also made match more general: now can match other stuff than strings

(not useful here, since we know 100% we only have strings)