Cleaned up FileDialog UI

Ironed out bugs like unsorted directories, files showing for no reason,
code indentation, etc.