REST: Added continuous feed version of _active_tasks

This lets REST clients get continuously-pushed replication activity updates.

If you add "?feed=continuous" to an /_active_tasks request:
* The response uses HTTP chunked mode.
* Each task object is sent as a separate top-level JSON object followed by a newline.
* The connection stays open forever, and subsequent activity changes are written immediately.

Fixes #27
Better logging if change tracker fails HTTP auth

If TDSocketChangeTracker gets a 401 or 407 and can't find a credential, or the credential is rejected,
it now logs a message of the form
    TDSocketChangeTracker[...]: HTTP auth failed; sent Authorization: %@  ;  got WWW-Authenticate: %@
showing the Authorization header it sent (if any, else null) and the WWW-Authenticate response header.
These headers are also returned in the NSError as keys "HTTPAuthorization" and "HTTPAuthenticateHeader"
(although this is of limited use since this info won't make it all the way up to the public replication API, yet.)
This should help in diagnosing issue #242.

Conflicts:
	Source/ChangeTracker/CBLSocketChangeTracker.m
	Source/TDStatus.h
	Source/TDStatus.m
Added CBLJSViewCompiler to the 'Extras' folder.
Hide passwords embedded in logged URLs

Passwords in URLs are replaced with "*****" when logged.
I don't think I've fixed all the places where URLs get logged yet.
File bugs if there are others.
Make returned error strings more compatible with CouchDB's

These strings are in JSON "error" properties in error responses and in individual items
of a _bulk_docs response.

Conflicts:
	Source/CBL_Router+Handlers.m
	Source/TDStatus.m
Make TDPusher more careful abut bumping the checkpoint

It now works similarly to the puller, using an NSIndexSet to keep track of which sequences haven't
yet been uploaded, and only advancing the checkpoint to just before the first sequence in the set.
This will fix possible edge cases/race conditions where the checkpoint may have been advanced too
optimistically, causing a doc that failed to be pushed once to never be retried. (Fixes #246)

Conflicts:
	Source/CBL_Pusher.m
CBLJSON should use milliseconds in ISO-8601 dates

CBLJSON was using an ISO-8601 date format string without milliseconds in it.
But ECMAScript specifies that date strings should have milliseconds.
I extended the code to (a) generate strings with millis, and (b) parse strings with or without them.
Added a test case, too.
Fixes #33.
Fixed broken links in README.

Fixes #35.
Added extra sanity checks around transactions.

Trying to figure out #34.
Use correct _session API URL for Sync Gateway

Now tries both /_session and /db/_session. Fixes #41.
Handle SQLite database-busy errors by retrying transactions (fixes #34)

It's possible for a SQLite transaction to hit a SQLITE_BUSY error partway
through (when it first tries to write) because another thread's
transaction got the exclusive lock first. In this situation it has to
back out of the transaction and then retry it from the start.

I added a new status code kCBLStatusDBBusy.

I added CBLDatabase.lastDbError to return the error status of the last
SQLite call, and added a whole lot of calls to it so that we get the
correct status code, so callers can detect a busy error.

-[CBLDatabase _inTransaction:] now handles kCBLStatusDBBusy by retrying
the entire transaction after aborting it, including calling the block
again. It gives up after 10 retries.

I removed the beginTransaction and endTransaction methods and changed
all the callers to use _inTransaction: instead. This took a lot of
gnarly changes to low-level code, especially in TD_Database+Insertion.m.
Catch & report exceptions thrown by map/reduce/filter/validate blocks
Tweaks to the new transaction code
Basic-auth improvements

* If a TDRemoteRequest gets an auth challenge and finds a new credential based on the Realm string,
  it now remembers that in its authorizer, and the replicator will pick it up and use that as its
  authorizer from then on. This should help pick up credentials registered with non-empty realms.
* TDRemoteRequest now tries the 'proposed' credential, if there is one, on its first pass through
  the auth challenge handler.
* Added more logging about the auth flow, for future debugging needs.

I am not sure if these will fix issue #242 but they should help.

Conflicts:
	Listener/TouchServ.m
	Source/CBL_Replicator.m
Some correctness tweaks to TDSocketChangeTracker

A futile attempt to address truncated feeds (#241); but I think these are
good changes to make anyway even if they didn't help that.
Oops, fixed build (stupid missing semicolon)
Added unit tests for +[CBLManager isValidDatabaseName:]

Investigating issue #43 ... these tests don't reproduce it.
Added a restriction that db name be < 240 characters long, so it fits in
an HFS+ filename even after adding a suffix to it.
Oops, fixed release build
Fix "removePending: sequence %lld not in set" warnings

Fixes #42
Workaround for truncated _changes feed responses

If TDSocketChangeTracker gets an unparseable response whose beginning
looks like the expected JSON, assume the socket got cut off by some
intermediary and go through the usual retry mechanism.
Fixes #241.