Local structure and magnetism of Cu-doped ZnO via Cu K-edge XAS and XMCD: theory and experiment