Added cyclic category checking. Set up test structure.