Add process selection
Split out the script code
Communicate with the remote agent