Use less globals in view helper examples

This isn't es6 specific, just hopefully more future-proof examples.