Refactoring and handling sequence number wrapping
Almost there with ACKs