support #4966 - refactor safemode rendering to allow helpers and variables from plugins