Improve tree and sitemap javascript.