Legacy js

Moved javascript which is not part of a web app into legacy directory, and updated corresponding perl files