Make main.js more node-friendly