Metal-to-Semiconductor Transition in Two-Dimensional Metal-Organic Frameworks: An Ab Initio Dynamics Perspective.