Imported sync.rb from MRI 2.1.
Bumped version to 2.0.0.