Terahertz time domain methods for material characterization of layered dielectric media