Assuming we have a Riemann surface $S$ of degree $n$ and we look at it as a covering of the projective line $\mathbb{P}^1$. If $B$ is the set of branch points of $S$ (when $B$ is a subset in $\mathbb{P}^1$), then there is an epimorphism from the free group $\pi_1(\mathbb{P}^1 - B)$ to $Sym_n$, determining this covering (birationally, I assume).
I have therefore two questions:
Was Riemann already thinking in these terms (of epimorphism to the symmetric group), or was it a later development? I assume that Riemann thought about his surfaces otherwise (in terms of algebraic functions and Abelian integrals?), and not as explicitly covering surfaces with epimorphisms to this group.
Who actually proved first the "reverse" theorem, that given a set of points $B$, if there is an epimorphism $\pi_1(\mathbb{P}^1 - B)$ to $Sym_n$, then there is a Riemann surface of degree $n$ branched along $B$?
===
EDIT: as was remarked below: "the ideas of coverings, the fundamental group, and the symmetric group, [...] [were] developed together"; I think nevertheless the the idea of a symmetry group existed before Riemann, but the developpment of the ideas indeed happened same time. Dieudonne writes in his book "A History of Algebraic and Differential Topology 1900-1960", p. 293, that: "In modern mathematics three notions are interconnected in such a way that each one essentially determines the other two: fundamental group, covering space, and properly discontinuous group. Historically, they appeared in the reverse order." The chapter "Fundamental Group and Covering Spaces" (pp. 293-310) in this book gives the historical overview on these topics.
It seems however, that it was Adolf Hurwitz who indeed connected these ideas together: "In 1891, Adolf Hurwitz published a paper on (closed) Riemann surfaces, understood as branched coverings of the complex number sphere with finitely many sheets and a finite number $n$ of branch points." (from: "History of Topology", ed. I. M. James, p. 327, from the paper of Moritz Epple, "Geometric aspects in the development of knot theory"). Hurwitz indeed refers there directly to the symmetric group. The 1891 paper of Hurwitz is called "Ueber Riemann'sche Flächen mit gegebenen Verzweigungspunkten". I assume that answers at least my first question.