Support arbitrary consecutive elements in template

Closes #25