Some refactoring, also added a resume function for choked
peers to continue downloading the piece they were choked on when unchoked