Pipelet template: fix "In strict mode code, functions can only be declared at top level ..."