Refactored some functions and finished logic for newPeerCh and havePieceCh in controller.go