Integrability of the quantum adiabatic evolution and geometric phases