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