Deleting documents and folders

I implement deletion of files and folders in the document section.
Mainly, I re-implement the way the JavaScript code is tested.  I use
deferred objects now to allow better access to internal code of the
widget while testing.