Refactor agent, workon tests

Change-Id: I62b4128b7a448dda502c1e645c7a659f5329e44f
Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>