Fix IETF language tag lookup

The IETF specification says the language tags should be treated as
case insensitive (see http://tools.ietf.org/html/bcp47#section-2.2.1) so
we have to discard the case when saving the languages and performing the
look-ups.
Merge pull request #172 from adamwdraper/pr/152

Pr/152