Adds ping listener and more tests.