Compact calculation of the perihelion precession of Mercury in general relativity, the cosmological constant and Jacobi's inversion problem