Simplify AKCN.

This makes AKCN closer to the hardware implementation. It's not quite
right - C doesn't work.
Source code updates.