Android Studio 0.4 compatibility changes:

Changed to Gradle 1.9 (minimum Android 0.4 supports) because 1.10 is broken for Android Libraries
Re-ran wrapper to upgrade to Gradle 1.9
Gradle 1.9 broken mavenLocal() so replaced with a work around
Needed to put in another gradle work around in order to run tests
This is an interim step on the way to finishing the auth work and some bug
fixes. But I wanted to commit it so we can discuss this on the call
with CouchBase.

ReplicationTest - Updated to the new getReplicator function arguments that can take a principal
Database - Just white space
Manager - Enhanced getReplicator to take a principal. Introduced a ReplicatorArguments
 class so the authorizer can 'see' the request the same way that the code does.
 But a better solution would be to use something like Jaxson.
 But I changed the rest of the code to use the ReplicatorArguments.
 I also removed the auth specific code and the HTTP URL check and instead
 call the authorizer to get a httpClientFactory. I also enhanced the
 replicator object to hold a list of principals and I call it here to
 add the local prinicpal if any.
ManagerOptions - Enhanced to take an authorizerFactoryManager and to auto-init
 to the built in persona/facebook authorizer if nothing else is provided.
ReplicatorArguments - Parses the replication request and puts the results into variables.
 This is needed so the security (authorizer) code and the execution code 'see' the
 same thing.
Authorizer - Enhanced this class so it can return an optional HttpClientFactory. I needed
 this for Thali because in order to support client certs and my own cert validation
 logic I needed to provide my own SSL Factory inside of the HttpClientFactory.
AuthorizerFactory - An interface for asking for an authorizer, the idea is that you
 that each authorizer has its own factory (we need a factory because we have to
 instantiate a new object and we can't do that generically in Java unless we
 know what arguments to use in the constructor and generally we won't, especially
 since we need a way to provide global values. For example, with Thali I need to provide
 the AuthorizerFactory with the client cert for the Thali DB which it wil then
 use when creating individual Authorizers.
AuthorizerFactoryManager - This lets you register one or more AuthorizerFactory
 objects and at run time the system will call the manager and see if any
 of the AuthorizerFactories can handle the incoming request.
BuiltInAuthorizerFactory - This provides an AuthorizerFactory for the Facebook
 and persona authorizers
FacebookAuthorizer - I turned Authorizer into an interface because I could (this
 leaves inheritance open) and so I updated this authorizer to support
 the interface including returning a null HttpClientFactory.
PersonaAuthorizer - See FacebookAuthorizer
Replication - I enhanced it to record one or more principals associated with
 the replication object. This can be used at runtime by authorization code
 so if a principal loses some right it's possible to walk through the
 active replications and see if any need to be stopped because the principal
 who created them no longer has the necessary rights to continue the replication.
RequestAuthorizer - Just added a note reminding implements that they can mess
 with the principal via the urlConnection object
Router - I pass in to getReplicator the principal (if any) on the connection object.
 I also added the ok field to the replicator response just to make my Ektorp
 code a little happier.
 I *think* (PLEASE VALIDATE!) that the code for setting new_edits was wrong. It ignored the
 value for new_edits in the request body, only looking at the URL. So I amended it to look at
 the request body as well. Also note that I set the default value for new_edits to 'true' which
 is not correct according to the CouchDB spec which says it should default to fault.
 I *think* (PLEASE VALIDATE!) that noNewEdits = !new_edits. If that isn't true then all my code is garbage. :(
 I then put in a one line fix that seems to fix replication bulk POST requests which is to set
 status to OK after successfully executing a forceInsert.
URLconnection - Added support for setting and reading principal on the urlConnection object.
Fixes to gradle so it will properly upload to our local maven server
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	.gitignore
	build.gradle
	src/instrumentTest/java/com/couchbase/lite/replicator/ReplicationTest.java
	src/main/java/com/couchbase/lite/Database.java
	src/main/java/com/couchbase/lite/Manager.java
	src/main/java/com/couchbase/lite/ManagerOptions.java
	src/main/java/com/couchbase/lite/router/Router.java
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	src/instrumentTest/java/com/couchbase/lite/replicator/ReplicationTest.java
Update setLastSequence to use checkpointId rather than remote URL

https://github.com/couchbase/couchbase-lite-java-core/issues/58#issuecomment-35457562
Issue #58 - add clearDBRef() and modify fetchRemoteCheckoint to have behavior similar to that on iOS

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #58 - changeTracker might be null, depending on how quickly one calls goOffline() after kicking off replicator, so check for null first.  It's a race condition.

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #58 - add updateActive() and setError() methods, and use them when appropriate to match iOS behavior.  Also change a call from batcher.flush() to batcher.clear().

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #58 - provide a way to check if the database is open (internal use only)

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #58 - only run query if the database is still open.  This avoids cryptic "attempt to re-open an already-closed object" errors in the logs.

https://github.com/couchbase/couchbase-lite-java-core/issues/58#issuecomment-35568540
If the database is not open, do not attempt to run a replication.  (as is done in iOS code)
Add support for publishing Source Jars
Issue #58 - was not calling asyncTaskStarted() and asyncTaskFinished() when making remote request to create a remote DB.  Needed for testPusher() to pass w/o having any exceptions.

https://github.com/couchbase/couchbase-lite-java-core/issues/58#issuecomment-35568540
Issue #58 - stop any remote requests currently in flight when calling stop() or goOffline(), matches iOS behavior.

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #58 - add a docchange.toString() method

https://github.com/couchbase/couchbase-lite-java-core/issues/58
Issue #85 - blobstore mkdirs() issue fix.

https://github.com/couchbase/couchbase-lite-java-core/issues/85
Add log to print cblite version
Issue #84 - fix by running the update() async.

https://github.com/couchbase/couchbase-lite-java-core/issues/84