Attempt at a tree in js