fixes #5053 - minor bug fixes to realm integration
fixes #5072 - x86_86 -> amd64 for FreeBSD media
fixes #5077 - refactor safemode rendering to allow helpers and variables from plugins