Fixes issue with repeated rendering.

Internally we are now using more of nunjucks nodes api. This has
simplified the code a greate deal.