Topology and dynamics of attractor neural networks: The role of loopiness