ISSUE 2:  Fix emit() calls mapping to the wrong ids.  This was causing rows.nextRow() to return the incorrect row.
ISSUE 2:  Fix emit() calls mapping to the wrong ids.  This was causing rows.nextRow() to return the incorrect row.

couchbaselabs/couchbase-lite-titanium,couchbaselabs/couchbase-lite-titanium