Improve build scripts of Web frontend
Improve detection of theme-specific JavaScript