Charge Density Waves in Layered Compounds