Define escaping functions outside of renderer.

Improves performance slightly or more.