Added closing 'script' tag

The ‘generate’ method is now adding a closing ‘script’ tag to JS
scripts. This is for backward compatibility.