Commenting language.php and some changes

Some commenting for Doxygen, simplified detect_language() a bit, added a new function get_language_name() that I will use soon or can be used in general to display localized language names from language codes.