Refactor NodeAgent as a separate module (for unit tests)

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