Improving the mock.js constructor to better model the real one.
Improving the mock.js constructor to better model the real one.

The callback on connection is a critical feature of the real
connection and was missing, so we've added it.
Still room for improvement.

Change-Id: I3bbda1c98af2a465947c985405cfb4eb48a07d2f
Reviewed-on: http://review.couchbase.org/39431
Reviewed-by: Alex McFadyen <b666d7e6b5399c72c59050b2162aea4cc1da4fef@acmconsulting.eu>
Reviewed-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>
Tested-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>

Bloutiouf/couchnode,couchbase/couchnode,GannettDigital/couchnode,KenanSulayman/couchnode,corbinu/couchnode,jess-sheneberger/couchnode,jess-sheneberger/couchnode,ConnectedHomes/couchnode,KenanSulayman/couchnode,actano/couchnode,KenanSulayman/couchnode,brett19/couchnode,corbinu/couchnode,ConnectedHomes/couchnode,KenanSulayman/couchnode,actano/couchnode,kshmir/couchnode,GannettDigital/couchnode,brett19/couchnode,GannettDigital/couchnode,ConnectedHomes/couchnode,brett19/couchnode,Bloutiouf/couchnode,kshmir/couchnode,kshmir/couchnode,jess-sheneberger/couchnode,ConnectedHomes/couchnode,Bloutiouf/couchnode,Bloutiouf/couchnode,corbinu/couchnode,actano/couchnode,couchbase/couchnode,couchbase/couchnode,jess-sheneberger/couchnode,couchbase/couchnode