Ideal theory on open Riemann surfaces