move JavaScript code into `js` subdir