changing is_dir checks to file_exists + include

Using file_exists instead of is_dir fixes the bug mentioned in issue #228. I blatantly copied this approach from https://github.com/Seldaek/jsonlint/blob/master/bin/jsonlint#L13-L18 . PhpUnit is using the same method as one can see in https://github.com/sebastianbergmann/phpunit/blob/master/composer/bin/phpunit#L40-L55