lots of structural improvements on  XML-to-JavaScript renderer