Order packages using packageDependencies

Add test for ordering