Adds onSync listeners
Renamed compare to diff. Reads better.