Added session::export() and improved session::import