Language selection: case-insensitive and system language

Fixed ignoring HTTP_ACCEPT_LANGUAGE tags that had uppercase
characters.

Fixed defining a->language too soon to ever get the system lang
Merge pull request #471 from solstag/master

Language selection: case-insensitive and system language