resurrect encoding / decoding and directives, actual meat not yet working
fix post-processing ordering
finally implement the bits to make encoding/decoding fully work again