As Iran and world powers reach a historic deal over its nuclear program, how will the agreement work and what happens next?