On Riemann's Theory of Algebraic Functions and Their Integrals