Agent refactoring for core

Signed-off-by: nigel <nigel.cook@hp.com>