Allow mutable documents to be returned from ConflictResolver:

* This required a refactor of the DocumentRevision class hierarchy:

  * DocumentRevision becomes minimal parent interface of BasicDocumentRevision and
    MutableDocumentRevision

  * Almost all existing usages of DocumentRevision change to BasicDocumentRevision

* Also ensure that attachments are correctly set for the new winning revision