Semi-infinite flags. II: Local and global intersection cohomology of quasimaps spaces Counting ramified coverings and intersection theory on spaces of rational functions. I: Cohomology of Hurwitz spaces 