added topological sort for deps
added bundle order checking