Generating Functional in CFT on Riemann Surfaces II: Homological Aspects