put app in its own file

this fixes an issue with Lua code cache