More cleanup in torrent source code, ready for stress tests.