Cosmological Perturbation Theory Using the FFTLog: Formalism and Connection to QFT Loop Integrals