Sort imports and dependencies