move __main__ part of recv/send to scripts/