Fix #53 - Refactor rsync

This is mostly a style cleanup, but I also was able to simplify a number of code paths, eliminate duplicate code, and fix a few bugs. I've also renamed a bunch of variables to make it more clear what's happening, broken things into smaller functions, and re-ordered some operations so the nesting isn't so deep.
maybe we should rename this to path instead of destPath coz again, we don't really care where the path is i.e. src/dest