Fixed failing assertion in CBLQueryRow due to unset _database

Recent regression due to the view indexing optimizations.
Fixes #403
Fix #310 Mutated sub model not being saved issue

* Add the code that checks for 'CBLJSONEncoding' protocol and assign
OnMutate block if the value implements 'setOnMutate' in the
'impForSetterOfProperty' method.
* Add 'API_SaveMutatedSubModel' test.
Fixes #336 Assertion Failed : _asyncTaskCount >= 0

The issue is that the result of the onCompletion block of the
CBLMultipartUploader could be null when there was an error occurred.
Hence passing the result object of the block to the removeRemoteRequest
method is not correct and will result to an error that the finished
uploader will not be removed from the remote request array.

When the app is suspended in the background, the replication (pusher)
will stop all of the requests that are in the remote request array.
Calling stop on the finished uploader will cause the onCompletion block
to be called again and will lead to the ‘Assertion Failed :
_asyncTaskCount >= 0’ error when asyncTasksFinished: method is invoked
inside the onCompletion block.

The fix is to use the original uploader object to pass to
removeRemoteRequest method instead of using the result object from the
onCompletion block.
Fixes Puller bugs that can cause asyncTaskCount out of sync

* Similar to the fix for #336 to the Pusher, ensure that we pass the
right request object to the removeRemoteRequest method inside the
OnCompletion block of the CBLMultipartDownloader and CBLBulkDownloader.

* Correct result type of the CBLBulkDownloader’s onCompletion block.

* Call removeRemoteRequest to remove the CBLBulkDownloader object
inside the onCompletion block.
Write a test case for #319
Fixes #319 overriding the response content-type

Setting the response content-type to 'application/json' when the
response has a body object but there is no content-type value given.
Merge pull request #404 from couchbase/feature/issue_310

Fix #310 Mutated sub model not being saved issue
Merge pull request #407 from couchbase/feature/issue_336

Fix #336 Assertion Failed : _asyncTaskCount >= 0
Merge pull request #412 from couchbase/feature/issue_319

Fixes #319 overriding the response content-type
Don't make internal symbols public, in the iOS static library

For #413
Fixed the targets so the test apps can still access+run the unit tests.

The debug builds of the static framework need to export all
symbols publicly so that the test apps can call the unit tests.

For #413
dd