Improve leading whit-space check
Add cli options
Add pid file to agent
Respond to SIGTERM