(#838) - added db.sync API

Based on [PR1071](https://github.com/daleharvey/pouchdb/pull/1071) from @garbados that addresses [#838](https://github.com/daleharvey/pouchdb/issues/838). Additionally updates usage of a clone() function to utils.extend(), exposes a global sync.cancel, and replaces <code>replications</code> prototype.