updated client to use an applicationfactory - have to refactor to use an abstract factory pattern

Signed-off-by: Richard Conway <richard@elastacloud.com>