Wip/rebase/receiver read write refactor

Rebase to include new gradle stuff.