Restructuring client tests to use promises.