route path setting cleanup

Some users have problems because they don't notice that the default settings have changed, in a previous merge. This commit removes the APPLICATION_ROOT define in settings and uses a core function to extract sub-directory through $_SERVER['SCRIPT_NAME'] instead.

This also makes the code follow the projects code standard a bit more too.