Setup logic for displaying the core JS, and setup the localized data. Also move the is_app logic to the is_app method
Add more conditions to check before reloading the query-var-ed page