Recognition and Complexation of Heavy Metal Ions in Ionic Liquids and Sol-Gel Materials