WIP Refactor payload handling into a common class. also WIP implementation of relaying