Add test for safe code output.
Extend doc for safe output.
Merge branch 'safe-output'