Refactor matchpats and walk
Move core match function code to util
Add some comments and whitespace
Simplify options
Use lambdas instead of always and never
#header## HG changeset patch# User #author## Date #date|date## Node ID #node##parent##desc##diff#