A Groupoid Construction of Functional Integrals