Tree data structure for Node.js