Fixes:1. If user_id = 0, try to retrieve the locale from the cookie. If not, fallback to the system one2. If the user locale is not set in her preferences, return the system one.
changing rendering of templating to use template::adp_eval instead of ns_eval, because eval in the adp seems to cause some include files to not get processed