Faster directory enumeration algorithm

Also added support for subdirectories.
Works only on Windows.