Sort dependencies
test also accept extra args