Here are the 2 tricky parts:
1. Powering the uC. You may want to avoid a bulky transformer but your options are limited.
2. Isolating the system. In some cases- all plastic case, rubber buttons, no output ports- this isn't necessary. But that might somewhat limit your features.
Simple leading and lagging can be calculated from zero crossings. But if you're gonna do it on a micro you might as well go all the way and calculate it across the sum of the waveform, calculate RMS current, THD, etc.