Residues and homology for pseudodifferential operators on foliations