Layer-by-Layer Methods in the Study of Photonic Crystals and Related Problems