Fix Torrent handling

Fix logging
move def removeEmptyFolders to top
Change extension matching to use simple tools
Change os.link