Added ability to set instance.

When passing a value to instance() for Cache, Captcha, and Session, the
passed value will be set as the instance and the previous instance will
be returned.  This also allows for simple tests, with the ability to set
a fallback:

  try
  {
    Cache::instance();
  }
  catch(Exception $e)
  {
    // Unable to connect, use null cache
    Cache::instance(Cache::connect(array('driver' => 'null')));
  }