The structure of automorphic loops