Moved code saving a publication to repo to Publication class