EIP-3779: Safer Control Flow for the EVM

@gumb0 I’ve merged your changes and the changes I had in progress, and I think we have the algorithm close to correct, thanks. At your leisure, you can take a look if you want. (And I suppose that at some point the code should be ported to Python.)