Do faster language code lookups

Currently _lang_code_get does a simple O(n) search to find the language code. This creates a lot of strcmp calls (there are over 450 languages registered). These strcmp calls do show up pretty high in a profiler like callgrind.
I changed the lookup to a hashmap implementation and verified the results with callgrind.