A toy torrent implementation I wrote many moons ago. Contains a tracker and a client.