hygiene, refactor pattern reading stuff into pats.[ch]

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
Merge branch 'tool/glep'

* tool/glep:
  hygiene, refactor pattern reading stuff into pats.[ch]