improvements to sync()

sync() function returns percentage of synchronized nodes, it also accepts optional 'quiet' argument