Simplify lang management and make it working in compile mode

I see. We have the same for getConfig and serviceUrl too.

Feels unnatural to me that an API depends on some correctly set global variables. Ideally, the loader could/would take care of all of this. I can make an attempt.