split out common logic
clean up
split out blob code from relay.h
whitespace fixes
split out relay_threads.h