Moved HTML wrangling to InlineWPDViewer and made better use of template