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
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.
Merge pull request #25 from mjq/doc_rev_npe

Fix NullPointerException in Document.getRevision()
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.
Merge pull request #26 from mjq/sync_listeners

synchronize access to Database's changeListeners list
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.
Add comment about tests that are currently failing.

https://github.com/couchbase/couchbase-lite-android-core/pull/27
Comment out tests failing due to what appear to be known bugs.  Will uncomment once there is more clarity on https://github.com/couchbase/couchbase-lite-android-core/pull/27
remove misleading "failed to rebuild view" logs

Log messages like

    W/Database: Failed to rebuild view Event/all: 500

are being printed every time a view is checked for re-indexing but is
already up to date. It looks like something's wrong, but it's a normal
state.

Setting the result to Status.OK suppresses these logs in the finally
block. The actual result (that reindexing was unnecessary) is still
printed at Debug level.
Merge pull request #28 from mjq/fix_log_warning

Remove misleading "failed to rebuild view" logs
always close response stream in ChangeTracker

In the ChangeTracker's run method, the response stream is sometimes left
unclosed.

When ChangeTrackerMode is LongPoll, the stream is closed after it has
been read with ObjectMapper.readValue(). But, in the OneShot case, the
stream is never closed, since the JsonParser never reaches the end of
the stream.

It might be possible for the LongPoll case to leak too if an error is
thrown, but I'm not sure. To be safe, I've wrapped both cases in a
try/finally block that ensures the response entity is always closed.
Merge branch 'refs/heads/stable'
TestHistoryAfterDocDeletion for issue 177 & 178
add TODO regarding better logging for exceptions
clean up testHistoryAfterDocDeletion() to avoid using private API calls.  once converted to public API calls it fixed the reason it was failing.
Merge branch 'refs/heads/stable'
add failing test demonstrating incorrect conflict replication

Replicates couchbase/couchbase-lite-android#174. Conflicting leaf
revisions aren't being sent in push replications.