Code clean-up (globals, $e107->, $mes, headers)