Thermochromic, Solvatochromic, and Piezochromic Cd(II) and Zn(II) Coordination Polymers: Detection of Small Molecules by Luminescence Switching from Blue to Green