Improved handling of added/removed folders and peers
Removed obsolete code