Functionalization of oxide surfaces by terpyridine phosphonate ligands: surface reactions and anchoring geometry.