moved {get|build}App inside try-catch; prepared for sapi/server.
created AppSetter to set up app; set baseURL to template.
fixed top link's baseUrl.
hack for cli-server. un-psr-2.