move some test-agent code to karma-test-agent lib based on bluetooth unit tests