doc: make gendoc.py module import policy aware
Without this, running gendoc.py during an install without C modules
available (via `make local`) will result in an import failure because
the default module load policy insists on C modules.
We also remove the sys.path adjustment because it is no longer needed
since our magic importer handles things.
check-commit: add a test for the patch checking script in contrib
This introduces a test for the change introduced in
8f5735b4aca5.
match: use re2 in readpatternfile if possible
This has a small, but measurable, effect on performance if a pattern
file is very large. In an artificial test with 200,000 lines of
pattern data, using re2 reduced read time by 200 milliseconds.