Split off optimisations in node.js code generation