The acquisition of phototrophy: adaptive strategies of hosting endosymbionts and organelles