Conform Accept-Language header parsing to ICU standard

Parsing the Accept-Language header to determine a user's preferred
language should follow the procedures established by ICU.  This
fixes both existing issues (e.g. changing case for languages like
en-GB) and allows more accurate language negotiation.