add type signatures, add comments to Torrent.hs