Fix handling of exitcode, name of "payload" key, add stub for shutdown.

I came across these errors while trying to create [octave_kernel](https://github.com/blink1073/octave_kernel).  Notice there is a TODO in there about shutting down gracefully.  I could not figure out how to do so.
This is a bit complicated. In the consoles, the kernel actually uses a payload to ask the frontend to kill the kernel and close itself. In the notebook, we don't really support shutdown from the kernel - the idea is that the frontend controls when kernels start and stop.