Refactored sync functions.

Syncing of files and directories used to be separate.  Now they operate on Entry objects.
Added non-root file removals.

Files can now be removed from subdirectories.  The getFileId function works on paths.