allow the agent to be in STATUS_SLEEP as well as STATUS_RUNNING

I see we were fixing this at the same time. Mostly compatibly changes, I included a check for the psutil module which I didn't have installed