Changes to html flatten script.
Test/debug, mainly of template evaluation.