Shell-escape macros.
Remove @threadsafety doc strings

Fixes #3889
Refactor the macro resolver

Fixes #3884
Add missing validator for Host -> Service -> notifications.
Fix syntax error in type validators.