Move utility functions to utils

Moving these three utility functions to their own module makes it easier
to import them without creating a Jinja2 environment as triggered by
registering helpers

Quick r?