huge refactoring: remove Torrent, move drivers to Session, refactor some data structures, fix warnings.