Add locale (language) state module

Also weaseled in a quick patch to keyboard state.