Refactored EnumSets to flagged enum.

Partial port of optional exclusion of attachments.
Exclude deleted revs from conflicts list.
Porting Database.GetDocumentWithIDAndRev