added pre-commit hook and hook installer, resolves #401

Issue #401.

Can I get some :+1:?