Add ref from att via refcode. Add tests.