Safer version of file deleting

Always use the `fs.moveToTrash` function to delete files. Previously `unlink` was used if `moveToTrash` didn't exist.

This way, if you are running in the Sprint 24 shell, trying to delete a file will just throw an error rather than permanently deleting the file.

The old behavior, combined with #3924, could lead to data loss.