Have ProjectExplorer use passed in array of files.

This is cleaner than having the ProjectExplorer fetch the files from the
server itself. It also makes testing more straightforward.
Fix error when deleting directories.