Clean up KEK code.
Add documentation for KEK/CEK functions.