Fixing up the scope soup, and adding a way to set core config items.
diff --git a/tests/lib/ci_testcase.php b/tests/lib/ci_testcase.php
index a8a272d..04216e2 100644
--- a/tests/lib/ci_testcase.php
+++ b/tests/lib/ci_testcase.php
@@ -4,10 +4,8 @@
 // Need a way to change dependencies (core libs and laoded libs)
 // Need a way to set the CI class
 
-class CodeIgniterTestCase extends PHPUnit_Framework_TestCase {
+class CI_TestCase extends PHPUnit_Framework_TestCase {
 		
-	public $ci_instance;
-	public static $test_instance;
 	public static $global_map = array(
 		'benchmark'	=> 'bm',
 		'config'	=> 'cfg',
@@ -23,23 +21,62 @@
 		'loader'	=> 'load'
 	);
 	
-	function __construct()
+	protected $ci_config = array();
+	
+	protected $ci_instance;
+	protected static $ci_test_instance;
+	
+	
+	public function __construct()
 	{
 		parent::__construct();
 	}
 	
 	// --------------------------------------------------------------------
 	
-	// Change what get_instance returns
-	function ci_instance($obj)
+	/**
+	 * Overwrite runBare
+	 *
+	 * PHPUnit instantiates the test classes before
+	 * running them individually. So right before a test
+	 * runs we set our instance. Normally this step would
+	 * happen in setUp, but someone is bound to forget to
+	 * call the parent method and debugging this is no fun.
+	 */
+	public function runBare()
 	{
+		self::$ci_test_instance = $this;
+		parent::runBare();
+	}
+	
+	// --------------------------------------------------------------------
+	
+	public static function instance()
+	{
+		return self::$ci_test_instance;
+	}
+	
+	// --------------------------------------------------------------------
+	
+	function ci_instance($obj = FALSE)
+	{
+		if ( ! is_object($obj))
+		{
+			return $this->ci_instance;
+		}
+		
 		$this->ci_instance = $obj;
 	}
 	
 	// --------------------------------------------------------------------
 	
-	function ci_set_instance_var($name, $obj)
+	function ci_instance_var($name, $obj = FALSE)
 	{
+		if ( ! is_object($obj))
+		{
+			return $this->ci_instance->$name;
+		}
+		
 		$this->ci_instance->$name =& $obj;
 	}
 	
@@ -101,7 +138,28 @@
 	
 	// --------------------------------------------------------------------
 	
-	static function ci_config($item)
+	function ci_set_config($key, $val = '')
+	{
+		if (is_array($key))
+		{
+			$this->ci_config = $key;
+		}
+		else
+		{
+			$this->ci_config[$key] = $val;
+		}
+	}
+	
+	// --------------------------------------------------------------------
+	
+	function ci_config_array()
+	{
+		return $this->ci_config;
+	}
+	
+	// --------------------------------------------------------------------
+	
+	function ci_config_item($item)
 	{
 		return '';
 	}
diff --git a/tests/lib/common.php b/tests/lib/common.php
index 482721a..994e9bc 100644
--- a/tests/lib/common.php
+++ b/tests/lib/common.php
@@ -4,18 +4,24 @@
 
 function &get_instance() 
 {
-	$test = CodeIgniterTestCase::$test_instance;
-	return $test->ci_instance;
+	$test = CI_TestCase::instance();
+	$instance = $test->ci_instance();
+	return $instance;
 }
 
-// Config Stuff | @todo High priority!
 // --------------------------------------------------------------------
 
-function get_config() { die('implement me'); }
+function &get_config() {
+	$test = CI_TestCase::instance();
+	$config = $test->ci_config_array();
+		
+	return $config;
+}
 
 function config_item($item)
 {
-	return CodeIgniterTestCase::ci_config($item);
+	$test = CI_TestCase::instance();
+	return $test->ci_config_item($item);
 }
 
 // --------------------------------------------------------------------
@@ -27,7 +33,7 @@
 		throw new Exception('Not Implemented: Non-core load_class()');
 	}
 	
-	$test = CodeIgniterTestCase::$test_instance;
+	$test = CI_TestCase::instance();
 	
 	$obj =& $test->ci_core_class($class);