Refactor rsync

Update rsync to working code
Add methods to use web sockets to communicate with client to perform a sync
But Im returning callback and assigning it: e.g. line 326