Controlled Encapsulation of Functional Organic Molecules within Metal–Organic Frameworks: In Situ Crystalline Structure Transformation