Haven't had to add any electrical components to the roof yet myself, but here's how I think I'd do it.
First, decide if you want to be able to disconnect the electrical easy if you ever pull the roof. My design efforts are usually highly modular and I would incorporate a connection of some type at the top/tub intersection.
Now, I don't have the liftgate rear, I have ambi doors, so this may be different for you. Generally I run as much wire outside as I can. Hence, I'd run the electrical cables along the frame and bring the wiring up in the rear corner into the cab. I have enough wires coming up here that I have opened up the existing hole there (I don't know if the hole is stock though) and now I essentially have a trunk-line setup into the cab here.
For the roof lights you could probably pull cable throught he door sill, drill a small enough hold to allow the wire out to the rack. As I mentioned above, I like modular designs so I figure I would wire in a female socket directly to the body up near the roof rack and then "plug in" the roof rack cables as necessary. This means you could pull the rack off without any wiring issues. As before, I'd also put a disconnect between the tub and top so that that could be removed as a unit as well.