Only pre-commit-hook on actual modules

The lack of a top anchor when checking for a filename of `modules` means that some specs were getting checked as well.

This is ultimately the root cause of the msftidy complaint on the specs in rapid7#3712

However, rapid7#3712 should still be landed because there are some nice cleanups to the REGEX compiles, the `@source.lines` business, etc.

If you review and land this to your branch, @kernelsmith I'll land rapid7#3712 (it all looks good to me, will eyeball more seriously in a sec)