Fix _const primitive
Wrap factor statements.
Output preamble and code separately.