Refactor rsync

Update rsync to working code
Add methods to use web sockets to communicate with client to perform a sync
Instead of repeating this block over every function, just do it once at the top of the file, and say that portions of the Anchor code have been used here, and are being included under the MIT License.