How are flaps controlled? I can understand what function(s) the flaps serve, but how are they controlled from an internal perspective? Does flipping the switch send signals to an electrical servo? Or is it hydraulics? How are these devices attached to the main wing body, and if they use hinges (which they probably do) where do the hinges connect to? Do these devices have "Control Horns" and "Push-rods" like RC Planes? This can also be generalised to apply to ailerons and rudders too.

EDIT: I'm primarily referring to small GA planes like the C172 and the PA-28 - So while I'd like to hear about air-liners too, I primarily want to know about its implementation in GA aircraft.
Flaps have different actuation mechanisms from primary flight controls. Flaps deflection brings a shift of pitching moment with it, and it is done slowly to give the pilot time to adjust the aerodynamic trim. Usually with electrical screwjacks, with a fine pitch that stops the forces on the flaps from feeding back into the motors.

Yes flipping the switch switches the electric motors on. Most jetliners use Fowler flaps, which ride out on their little rails attached to the wing, and clad with an aerodynamic fairing at the trailing edge. This picture (source) shows the rails, flaps, and screwjacks when completely extended.