Add a bytecode encoder and decoder

And prove that they are inverses.  Mostly for fun