Refactor and separate peer and proxy connections + define proxy wire messages format