Did you remember to add $CI =& get_instance();
in your library's constructor or at the top of your helper file so you can use all the CodeIgniter resources in your libraries and helpers? (see also here in the docs)
You can then call CodeIgniter resources like this:
$CI->load->helper('file_helper');
read_file($file);
$CI->load->library('session');
$CI->session->sess_destroy();