Changed a bunch of internals in doc.
Fixed a bug with already established connections being in the wrong state
Merge branch 'rewrite' of https://github.com/josephg/ShareJS into rewrite