Simplify control flow a little
separate reading and writing of document data
More UIDocument-like storage of "contents" during saving
Simplify async save completion handler code a smidge
Shift bulk of writing work into _contents block
Handle backing up a document that's only been autosaved so far
Make duplicates by autosaving doc, then copying raw files

Avoids upsetting SQLite store's tracking of changes
Handle duplicating brand new doc with no changes made yet
Fix compilation under ARC
Tweak ivar handling to quieten false ARC warning
Fix error mishandling spotted by static analyzer
correct comment
Factor out -createPackageDirectoriesAtURL:…
Create directories only when expecting to
Merge branch 'ksmanageddocument' into duplicate-sqlite-stores
Pass saveOperation explicitly to block to avoid confusion
Ugly, ugly hack to enable reversion of docs with unautosaved changes
Autosaved contents take precedent over regular ones
Use -mostRecentlySavedFileURL for DRY
Autosave-elsewhere existing saved docs by going via a temp location