Fix pointer bug in dea agents listen to instances changes, refactorings

Signed-off-by: Mike Gehard <mgehard@pivotallabs.com>