         @last_version_received = 0
         @edit_stack            = []
 
+    status: () =>
+        return {'id':@id, 'live':@live, 'shadow':@shadow, 'shadow_version':@shadow_version, 'edit_stack':@edit_stack}
+
+    restart: (reason) =>
+        console.log("*********************************************************")
+        console.log("* THINGS WENT TO HELL. -- #{reason} --  HAVE TO RESTART!!!!! *")
+        console.log("*********************************************************")
+        throw("dang")
+
     # Copy a document; strings are immutable and the default, so we
     # just return the object.
     _copy: (doc) =>

    client.live = 'bar1\n' + client.live
    server.live = 'bar2\n'
    status()
    client.push_edits()
    server.push_edits()
    status()

exports.DSync = DSync
    _apply_edits: (edits, doc) =>
        return dmp.patch_apply(edits, doc)[0]

    # Return a checksum of a document
    _checksum: (doc) =>
        return doc.length

    # Connect this client to the other end of the connection, the "server".
    connect: (server) =>
