Refactor JS application loading via appconfig.