add newlines to extern Lua code
use Lua prelude by default for now
fix a bug in code gen