Tree viewer in pure js