Refinements for PSC sync part. #3826.

* Correct keygen so that it is random for a run, not random for each key
* Don't save on the cases side if the PSC sync fails
* Debug logging
Use importer_mode if available. #3826.

A clone is like an import in that you are looking to get an exact copy
of the source data. The same sort of record-creating callbacks that
are disabled for imports should be disabled for clones also.
Factor out "importer mode" flag & related. Done with #3826.

Also addresses #3848 along the way.
Disable operational data extraction in import mode. #3826.