Use `file` to determine which files are Python files

This also refactors the pdb checker to use the same grep command as the grep checker, and files_for_commit to return a list of filenames (rather than a `bash` object).