fixed some tests and added component ordering function to depgraph