Refactored bittorrent code into a separate manager.