Javascript tree implemented.