Added topological sort for components ordering
Added TermIndexAtom for indexing over a generic term of an atom