Cleaning up git hooks.

Also updated .gitignore to ignore more generated files that popped up after running the pre-commit git hook. 

Fixes #1422.