Started refactor and added cluster-wide logging from tests.