Do not load common.inc for js/get_scripts.js.php

No functionality is being used there and the token protection only
causes troubles.
Properly detect variable presence
Simplify file name validation

We don't want to expose possible hidden files as well (starting with .
on unix).
Merge pull request #729 from nijel/jsscript-common

Do not load common.inc for js/get_scripts.js.php