I think about use an extended version of Config and Lang variables.
In my CLI I use a simple class, cloned from Joomla!.
I think this should be implemented in functions.inc.php.
With this class you can read even lang and conf option in classes. This is not working with globals.