The module can be obtained here
for about US $3.00 in single quantities, shipping included.
The 3-watt design means that there is no voltage over 5-volts on any of the LEDs, and they are completely isolated from the mains.
The large "MHX" capacitor seen in the images is used to filter the input, so its wire leads do carry high voltage. Cover them with electrical tape to be safe.
The "Green-mode" design rectifies and smooths out the mains voltage and uses it to drive an oscillator at about 100KHz. This square-wave is applied to a small flyback transformer which converts it to a much lower voltage . The currents in and out and the temperature are measured 100000 times a second and the oscillator is turned off until proper operation is restored.