Two-loop integrals for CP-even heavy quarkonium production and decays