Add short circuit to filtering for performance

TODO there is a big performance problem.
Support for | in pathkey.
Add support for regexp.
Add exit status for diff and fix newline on empty diff.