Refactor all_languages and all_language_infos

* avoid duplicate entries in result list
* move common code in one function
Use generator in generator instead of generator in iterator
Merge pull request #354 from nidico/feature-refactor-all-languages

Refactor all_languages and all_language_infos