update javascript-library template
fix #1087

FIX: move cli-scripts to build-directory and protected them
In addition, this prepares #844.

@mipapo: Please add .htaccess-protection for the directory/files.