Document kernels.
Add missing unit tests.