Cleaner declaration of isSubfolder()

Fixes one call to isSubfolder that was passing an object and not a DOM
element
Need to call removeAttachCallback after deleting an attachment