Add data rollback for functional tests

Functional tests were modified in order to provide cleaning of db after
tests execution. Some non-major refactoring was made to different
modules. All tests were update.

Change-Id: I1ae3ca6f8679da8fa73df461a701b8703c12b8eb
Merge "Add data rollback for functional tests"