refactor agent support into common
AGENT_DEFAULT should be -1
envoyd: refactor connection handling
standardize on -t,--agent=
add more status messages
refactor some code
move to an event based loop