Simplified tree building

Tree building is now made outside and every existing nodes are in DOM