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