fixed some problems and broken code

- deleting files and folder should work now.
- handling for share-keys seems to be incomplete

this fix was tested with the latest files_encryption branch because the version in this brach has some issues 

@schiesbn please merge this into files_encryption brach so it will be easier to develop and test.