Move kernel-side helpers to kernel_helpers.py (fix docs)