Refactor and redocument codegen.
Add length field to expression list.