Fix #53, refactor lib/rsync.js