Issue #190 - fixes to the code to make the test pass

The main change is to use a LinkedHashSet rather than a List, because dupes were getting in the inbox (which could merit further investigating).

Also, the online state wasn't being correctly set everywhere, nor were notifications being sent out to change listeners at all times.

https://github.com/couchbase/couchbase-lite-android/issues/190