using KernelManager provided by IPython to replace hand coded subprocess manage