Delay many re.compile calls.
Review Request #3122 — Created Nov. 14, 2015 and submitted
This is done either by moving the compile calls out of module scope, or by importing code lazily. This takes re.compile from 11% of startup time, and 100s of calls, to 3.5% of startup time, and tens of calls.
Ran relevant tests locally.
CI passes: https://travis-ci.org/pantsbuild/pants/builds/91066061
Thanks John! Submitted as 0d95104ee4cc4a27af7549a09c849ed9fdcfdfeb.