update-buffer falls back to replacing the whole buffer, if :begin :end properties are missing
condense and fix diff functions
make sure merge-local leaves a consistent local state
merge-local has to delete from the local tree
greatly simplify merge-new-remote

as event-to-headline is already powerful enough