More verbose logging of scanning errors
Fix db.PurgeOrphanFolders() by scanning for no contained files in the filesystem
Decouple filesystem functions for orphan folder scan