add app_dir var to point to root of application

This should fix #548

We could still rename the other endpath variables, but i plan
on doing something with them in future commits.