Metabolic integration of the chloroplast during endosymbiosis