All tests use the same database instance (Cloudant or CouchDB)
Retry revisions which fail to replicate with a 412

This indicates something is confused with attachments stubs. We can
safely resend using a multipart/related POST which includes all the
current attachment data. This is inefficient, but allows us to
safely replicate in the face of revpos bugs and matches CouchDB
behaviour.
Add Rake command to run replication acceptance tests on simulator
Remove spurious comment.
Add a test which will always cause a 412 to check our retry logic
Merge pull request #31 from cloudant/31142-retry-on-412-error

31142 Retry sending revisions if we get a 412 missing_stub response for a document
Adds CDTConflictResolver protocol
Adds TD_Database+Conflicts, which provides low-level interaction to conflicted documents.

Adds CDTDatastore+Conflicts
* wraps TD_Database+Conflicts -getConflictedDocumentIds
* moves conflictsForDocument from CDTDatastore to here
* implements enumerateConflictsUsingBlock (private)

Adds DatastoreConflicts tests

Replaces -getRevPrefix with TD_Revision generationFromRevID

There's a bit of code commented out in this commit as it's not quite ready. There
are some changes to TD_Database+Insertion that I want to do incrementally but don't
want to deal with the removing this code for later.
Breaks out a putRevision method to be used within a database transaction.

Adds TD_Database+Insertion -putRevision: winningRev: prevRevisionID: allowConflict
status: database:
This also fixes a bug regarding the winningRev pointer. Previously, winningRev
was always nil. This never seemed to affect database behavior because winningRev
is only used for notification purposes. This fix seems to be what the original
author indented and also seems to match the functionality of current CBL code.

Adds a few checks in DatastoreCrud for nil content of a CDTDocumentRevision object,
which was useful when finding bugs while breaking out -putRevision:..database
Fixes inTransaction so that it behaves as intended. rollback was set to
YES when the TDStatus was not an error.
Adds the CDTDatastore+Conflicts -resolveConflictsForDocument code and tests.

The -resolveConflictsForDocument:resolver:error method is used by external developers
to facilitate conflict resolution. The caller of this method supplies a delegate object
to perform the resolution, while this method takes care to insert to the new revision
into the database and to ensure the document is no longer conflicted by adding a deleted
revision to the appropriate leaf nodes.

Adds DatastoreConflictResolvers.h and .m, which define example objects that
follow the CDTConflictResolver protocol and are used in these tests.

Adds the excludeDeleted: option to TD_Database -getAllRevisionsOfDocumentId. This
allows TD_Database to return all of the active current revisions for a document that
are not 'deleted'. This set of revisions are the confliction revisions of a document.
Fixes bug where the TDStatus variable was not set on error before returning.
Merge pull request #22 from cloudant/27991-conflicts-v1

27991 conflicts v1
Adds support for filtered pull replication and reorganizes the
way replications are specified and initiated.

Adds CDTAbstractReplication, CDTPushReplication and CDTPullReplication,
which are used to encapsulate the data necessary to start a replication.
CDTAbstractReplication is the "abstract" base class for CDTPushReplication
and CDTPullReplication.

Adds CDTReplicatorFactory -oneWay:(CDTAbstractReplicaiton *):error(NSError**),
which accepts a CDTAbstractReplication object to specify the replication.
This method returns a CDTReplicator, which may be used to execute the
replication (CDTReplicator -start).

CDTReplicatorFactory -onewaySourceDatatore:targetURI and
-onewaySoureURI:targetDatatore will soon be deprecated in favor of
-oneWay, which is documented in this commit.

CDTPullReplication supports filtered replication from the remote server.
This code does not make any query to the remote server to ensure the
existence of the remote filter function.

Tests (and supporting methods) were added to the ReplicationAcceptance
project and to CDTReplicationTests.m in the Tests project.

Updates the documentation README.md and replication.md to instruct use
of the new CDTReplicatorFactor -oneWay:error: method.