Have the codec return a plain ArrayBuffer instead of an ImageData

prep work for web workers...
Note this seems to mean we have to manually copy the buffer into a
target ImageData structure, instead of just creating a structure
around our data. Boo!
tweak vars
Fix bad order of operations that broke streaming sometimes