Formation of membranes comprising organic and inorganic components