simplified code and support for progressive rendering and early flush of head for performance reasons. One needs to override render method in DefaultTemplateRenderer

Change-Id: I2fba48c477774e859bc6808d7c505d8fbd386f98