Refactor Repository.write(), and write_delegated_metadata()
Resolve merge conflict
Continue refactor of libtuf.py