Decouple doc concept from DocEditor, fix some syncing timing logic.
Renamed DocEditor to Editor, since it no longer knows about Docs.