Topological partition functions and (iterated) integrals of modular forms