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 <couchbase@acmconsulting.eu>
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Brett Lawson <brett19@gmail.com>