Don't display languages based on ULS heuristics if I have a Babel box

If a user does have a {{#babel:en}} box with a single language that
happens to be the interface language, the server side PHP code will
not display any alternative languages. But the client side
JavaScript code (which uses ULS heuristics) will, even if the users
Babel box clearly says "English only".

A possible solution to fix this is to expose the existence of a
Babel box to JavaScript, either via DOM (hidden DIV or data
attribute) or via a global wb... variable as I did now.

Checking for isAnon (wgUserId === 0) isn't a solution since this
would remove the usefull ULS heuristics from all users that don't
have a Babel box.

This patch includes major refactoring to make the code depend a
little bit less on the Babel extension.

Bug: 61446
Change-Id: Iaac36e64bd9dd628e3f75d0e2df9cdb330e0f528
Merge "Don't display languages based on ULS heuristics if I have a Babel box"