Localization infrastructure

Redo our localization infrastructure so it works from pages and with AMD loading. We reload the page when the language changes. API documented, tested. Automatically detect language.

Login page not yet translated, but can be.
What about prepending the cookie value to the values from Accept-Language instead of overriding the latter completely?  This only makes a difference in strange scenarios, I guess...