Add means of accessing Kernel from ScopedKernel and use it to implement auto corelint without scope-breaking hack.