making kernels and solvers picklable