Improve _has_secret() logic and tests.
Improve export/import_recovery_document()

* Fix docstrings.