Quantum terahertz electrodynamics and macroscopic quantum tunneling in layered superconductors.