Fixed bugs saving replication checkpoint

* Updating the checkpoint should not be canceled when the replication goes offline or is told to stop.
* The lastSequence stored in the db at the end should be the lastSequence saved remotely, _not_ the current lastSequence (which may have changed.)
* Added a Sync log message when the checkpoint is successfully saved, for future debugging.
Router should not try to parse URL params as JSON for changes feed

From the CouchDB docs it seems pretty clear that the extra URL query params in
_changes feed requests are passed directly as strings to the filter function, without
any JSON parsing.
(See http://docs.couchdb.org/en/latest/couchapp/ddocs.html#filterfun )
Fixes #321
Change CBL_Replicator progress notification postingStyle to NSPostASAP

This will deliver progress information more quickly.
Fixes #396
Made CBLWebSocketChangeTracker work correctly with CBLAuthorizer

Also found that it didn't work correctly if usePOST property wasn't set,
so I fixed that too.
Fixes #400
Skip FMDB thread-safety check when running on dispatch queues.

Fixes #376
Better handling of a model's document being deleted

* Clear all properties
* Clear needsSave flag, remove from db's docs-to-be-saved set
* Detach from document even if the model didn't initiate the save
* Don't call didLoadFromDocument
Fixes #363
Enable JS filter compiler support

The function CBLRegisterJSViewCompiler() now also registers the JS
filter compiler.
Also, enabled JS filters in LiteServ.
Oops, actually enable JS filters in LiteServ
Allow logging to be redirected, and use NSLog on iOS devices

* Added +[CBLManager redirectLogging:]
* On iOS devices, always log to NSLog, since stderr output doesn't get
  saved anywhere that can be viewed later.
Fixes #395
Add JSONObjectWithDate:timeZone: to get a date with tz-offset.
Add Tests for +JSONObjectWithDate:timeZone.
Added more auth-failure error codes to CBLIsPermanentError

See https://groups.google.com/d/msgid/mobile-couchbase/35f2db0b-bd47-4579-9afa-23f92745eeb0%40googlegroups.com
Merge pull request #401 from monowerker/topic/date_w_tz

Add time zone support to CBLJSON date formatter
When retrying a replication, make sure to get session & checkpoint

Especially important if the replication initially failed to create a
session or fetch the remote checkpoint, because then we don't have one
at all. (This could have been causing checkpoint conflict errors.)
ChangeTracker should map NSURLErrorUserAuthenticationRequired to 401

The HTTPLogic class returns the lower-level code, but everywhere else
we use 401.
Added unit tests that force replicator auth failures
Fixes for SSL server cert trust checking

* CBLSocketChangeTracker now allows a self-signed cert, provided the
  replicator allows it (i.e. app has configured that root cert.)
* Treat SSL errors as permanent so the replicator will stop on one.
* CBLRemoteRequest now returns the correct error when it comes across
  an untrusted server cert. (Invalid-cert, not auth-canceled.)
Unit tests for SSL replication
Custom sorting of CBLQueryEnumerators

Added CBLQuery.sortDescriptors,
and -[CBLQueryEnumerator sortUsingDescriptors:].

Conflicts:
	Source/API/CBLQuery.m
Fixed failing assertion in CBLQueryRow due to unset _database

Recent regression due to the view indexing optimizations.
Fixes #403