File/dir flags: factor out into separate class

The flag logic is shared between files and directories, so it makes sense to
factor it out into a separate class. This also provides a more natural place
for the Win32 property string conversion functions that common.inc.php.