Probing the biogenesis pathway and dynamics of thylakoid membranes