Added hook init boilerplate
Added boilerplate for the pre-commit hook
Changed the order of some errors
Setup the pre-commit hook

This is very nasty right now and should probably spit out warnings if
you already have a pre-commit hook set up.
Added const qualifiers to some pattern functions