In-process kernel support (take 3)

This PR continues PR #2397 now that @epatters is offline. The previous PR has been closed and this one will take its place.

I fixed the Python3 issues that got PR #2397 stuck.