Port unit tests

* Port unit tests from CBL Android as of v1.0.0.
Merge pull request #324 from couchbase/port-unit-tests

Port unit tests