New PWM implementation

The old implementation suffered when SoftDevice was under use. The new
implementation is more robust.