Move `Kernel.local_variables` to core.