refactor master network logic

Finally got around to figuring out and testing implementations of the
master server which would work best, settled on this form. Progress can
now be made, elsewhere hopefully