Fix twig end tags, fixes #617

How about a shorter version:

    var TAGS = 'autoescape block ... ';
    TAGS = TAGS.concat(TAGS.split(' ').map(function(t){return 'end' + t}));

(didn't check, just showing the idea)