Fix codegen for new compiler.

* src/pf/codegen.lua: Fix recent codegen change.
Small tweak to read_buffer_word_by_type

* src/pf/codegen.lua: Reflow read_buffer_word_by_type a bit, and emit
  constants if possible.