reorg and switch to new Node.js architecture