Initial work on detecting self-referencing types
Find references to inner types, generalise refersToSelf accordingly