add WordTemplateLogic.ValidateTemplate and rewrite ParseDocument algorithm