Single-valued hyperlogarithms, correlation functions and closed string amplitudes