Refactor create-branch into checkout which does more.