Make ts.forEach() also pass in the element's index to its callback.
Don't emit an empty template head literal if there's a template span with a non-empty literal.

Fixes #1570
Update tests and baselines.