Refactor rsync

Update rsync to working code
Add methods to use web sockets to communicate with client to perform a sync
You're mixing `forEach` and `map` logic.  With `forEach` you create an external variable, they reference it in your iterator callbacks.  With `map`, you return modified objects in each iterator call, building a new array.  You want this:

```javascript
var srcContents = !dirPaths ? [] : dirPaths.map(function(element) {
  return element.path;
});
// srcContents is now an array of path strings or an empty array.
```