Use manifest.json instead of manifest.js

The manifest.json files are generated automatically from the sources by the script updateJS.js, which also runs JSLint.
Dependencies are stored in manifest.json now. This allows the loading of modules to be more efficient, since all the required modules can be determined before loading.
Generate list of JavaScript files in CMakeLists.txt.
Some types needed to be fixed due to the new file order.