Speedup travis-ci for pull requests

Cache result of `git diff`
Use python's re module instead of calling subprocess for simple grep