fix pageTypeWithLayout for appScripts
change initCelements macros call to be optional in app.vm