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.
Locale only takes one argument.