Add travis build and pre-commit hook.