Add a pre-commit hook to check tests and docs where appropriate.

This is to help with the commit process and increase the chance that Travis will pass when you commit.