Add restart magics and a kernel restart method