Don't crash on error when nil is passed as error parameter
Fix a compilation error in Xcode 6
Fix sequenceNumber property on TD_Database
Make sure updateIndexes uses only correctly registered indexes

Previously, if an index had been registered in a previous session,
the index manager would try to update it even though an indexing
function hadn't yet been registered this session. This would result
in indexing nil values for any documents updated or added during
the period between the index manager being created and ensureIndexed
being called, but the index thinking it had successfully updated
itself.

This fixes FB31844.
Merge pull request #34 from cloudant/31844-miss-indexing-docs

FB31844 Close window where documents may miss being indexed
Add tests for CDTDatastoreChangeNotification event firing

This event should be fired for create, update and delete. It can be
on a specific datastore, or globally.

This also fixes a bug where updates didn't fire an event.
Document datastore events in docs/events.md
Merge pull request #33 from cloudant/28682-events-docs

Add documentation for CDTDatastore change notifications FB28682
Preserve identity of winning revision returned when resolving conflicts.

Previously, the conflict resolution framework would append the
CDTDocumentRevision object returned by CDTConflictResolver -resovle:conflicts:
to the current winning revision in a document's tree and then
delete all other conflicting revisions.

This update makes the following changes:
* Restricts the CDTConflictResolver -resolve:conflicts: method to
return one of the CDTDocumentRevision objects found in the conflicts
array it was given. This completely forbids any new CDTDocumentRevision to
become the new winning revision (this is temporary).
* The CDTDocumentRevision returned by CDTConflictResolver -resolve:conflicts:
becomes the new winning revision by deleting all other conflicting revisions
in the document tree.

In addition, this solves the problem with attachments not properly migrating
the the new winning revision since we no longer create any new revisions to the
document tree. (Cloudant FogBugz 31053)

CDTDatastore+Conflicts is modified accordingly.
CDTConflictResolver.h documentation is modified.

Tests are modified and created in DatastoreConflictResolvers and DatastoreConflicts.m
Tests for conflict resolution of documents with attachments are added, along with
a bit of cleanup and better failure reporting.