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.
I think we should just check for falsiness here, not just undefined.