pwm_lut: make nicer

Now with command-line arguments!
Also fix some bugs to make the edges of the LUT sane.