Working communications to authenticate against server
Agent now can register devices
Updated to support popen call