move functions in lang_update to functions.inc.php
move error_logging to its own function for better logging flexibility and potentially use monolog library in the future
rename  as