Accept being passed nil as error in -getDocumentWithId:...
Fix replicating attachments with revpos > doc generation

This is an import from:

couchbase/couchbase-lite-ios@b5ecc07c8688a5d834992a51a23cd99faf8be0db
Add shared methods for remote db code in ReplicationAcceptance
Use local CouchDB instance for all attachment replication tests
Use NSData rather than NSInputStream in attachments API

This was changed for a couple of reasons: gzipped attachments
and general API trends external to the library.

* Supporting gzipped attachments

This also allows us to inflate gzipped attachments before
returning data to client.

Some content types are zipped before storing on disk during
replication (or they come compressed from CouchDB and saved
to disk without removing the compression).

This paves the way for us to compress certain types when
added through the Cloudant Sync API.

* Why NSData rather than NSInputStream?

The iOS and OSX APIs appear to generally prefer working with either
NSData (e.g., UIImage imageWithData:) or file paths/URLs (e.g.,
UIImage imageWithContentsOfFile:). So providing NSInputStream
interfaces, while potentially more efficient, seemed like it would
be an overhead -- people would be forever writing these to files or
NSData objects anyway.

* Tests

Test which replicates gzipped data from remote database. We
need to fix exposing this data through our attachments API.
Open CDTDatastore's underlying TD_Database on -init

This helps to make sure initialisation code is only called
from one thread.
Allow results of -getAllDocuments to be used in -attachmentsForRev:...

-attachmentsForRev:... makes use of the sequence number, which
wasn't added to the TD_Revision by -getAllDocuments.
Allow comparing attachments of documents in a local and remote db
Add further attachment tests to ReplicationAcceptance

testReplicateManyLocalAttachments tests creating lots of local
attachments are successfully replicated.

testAddLocalReplicateDeleteLocalReplicate checks that deleting an
attachment from a local document that's already been replicated
remotely is replicated during a future replication.

testReplicateRemoteDocumentUpdate tests that updates to an
attachment are replicated correctly.

testReplicateRemoteDocumentDeleteLocalCheckReplicated tests that
deleting an attachment is replicated correctly.

testReplicateRemoteDocumentDeleteRemoteCheckReplicated tests that
deleting a remote attachment is replicated correctly.
Add a rake command to run ReplicationAcceptance tests
Add a rake command to pod update all projects
Significant cleanup of ReplicationAcceptance attachments tests
Merge pull request #28 from cloudant/30441-replication-attachments

30441 Add tests for replicating attachments to ReplicationAcceptance