Write test that reproduces issue #24.  Also rewrite test to run faster and be simpler.  Minor change to ChangeTracker to support being inspected by test.

https://github.com/couchbase/couchbase-lite-android-core/issues/24
Fix for issue #24.  Unit test added in last commit now passes.

https://github.com/couchbase/couchbase-lite-android-core/issues/24
Share code between testChangeTrackerBackoffInvalidJson() and testChangeTrackerBackoffExceptions()
fix NullPointerException in Document.getRevision()

If you try to get a specific revision using Document.getRevision, but
the current revision has never been retrieved (and so currentRevision is
null), a NullPointerException is thrown.
Write test case to try to repro issue #165.  Found bugs in both the Database.delete() and the Manager.getExistingDatabase() methods.

https://github.com/couchbase/couchbase-lite-android/issues/165
When deleting a db, it needs to remove it from the manager's list of cached dbs.

https://github.com/couchbase/couchbase-lite-android/issues/165
When deleting a db, it needs to remove it from the manager's list of cached dbs.

Also getExistingDatabase() was passing wrong value for mustExist flag.
https://github.com/couchbase/couchbase-lite-android/issues/165
synchronize access to Database's changeListeners list

Iteration over the changeListeners in Database.notifyChange can throw a
ConcurrentModificationException if addChangeListener or
removeChangeListener is called from another thread.
Wrap in a try/catch: adding cookies.  (if this fails, should log an error but not break the whole request).

Issue discovered when using Mock Http Client
move createDocumentWithProperties() into LiteTestCase
Add a response delay and refactor a few things into methods to be clearer.
Add testPushPurgedDoc() which detects issue #167.

https://github.com/couchbase/couchbase-lite-android/issues/167
Update comment to point to couchdb docs
Add testLoadRevisionBody() which detects the root cause of issue #167

https://github.com/couchbase/couchbase-lite-android/issues/167
loadRevisionBody now throws exception with appropriate status when it can't load the revision body.  (Issue #167)

https://github.com/couchbase/couchbase-lite-android/issues/167
If not possible to load revision body, don't add this revision to outgoing _bulk_docs.  Don't send anything if there are no outgoing _bulk_docs.  Fixes #167.

https://github.com/couchbase/couchbase-lite-android/issues/167
Functional (cblite-tests) tests were still not passing due to a race condition.  Details below.  (issue #167)

1) replicator thread: call db.loadRevisionBody for doc1
2) liteserv thread: call db.purge on doc1
3) replicator thread: call db.getRevisionHistory for doc1, which returns empty history since it was purged

Fix/workaround by making the purge operation happen in serial with the replicator work queue.

https://github.com/couchbase/couchbase-lite-android/issues/167
Merge branch 'refs/heads/stable'

Conflicts:
	src/instrumentTest/java/com/couchbase/lite/replicator/ChangeTrackerTest.java

Also I had to make a manual change to CustomizableMockHttpClient to remove duplicated methods that broke the compile.
add failing Database change listener test

Assertions marked with the comment "fails" currently fail, but should (I
think) pass.
fix stale revision properties in Database change listeners

Since registered change listeners were called before the cached
document's revision history was updated, some revision-related document
getters would return stale data.

Updating the document's revision history before notifying the database's
listeners lets change listeners see the latest data.