Fix iteritems() usage when no pillar are defined

As a side effect, simplify Jinja templates.