Core logic for Butter, a toy torrent client (*to be*) written in haskell.