Characterizing Distribution Equivalence and Structure Learning for Cyclic and Acyclic Directed Graphs