An easy way to create a tree structure in JavaScript