Initial port of output.js to output.pyj