Fix handling of directories.

This ensures that directories are not returned even if they are
"executable".
Remove special handling of '.' and '..' directories.

Now that directories are detected and treated properly, there is no need
to handle '.' and '..' in a special way.