Finished grouping of classes to one file based on inheritance (so far only direct, no mixins).

Improved checks of topological sort method.