Bug 25489 - [Imports]: Script execution order is non-deterministic in cyclic cases

This change gets rid of the notion of "cycle" and introduces "branch" concept intead.
The intention here is that we model it based on minimum spanning tree of the import graph,
instead of based on DAG, marking cycle eliminated from the import graph.

Although this change affects the definition of "import predecessor" and "import parent",
actual blocking criteria shouldn't change, except the case that pointed at the bug 25489.
This should just make the behaviour more deterministic.