Sort require order

External libraries are required first. Then internal libraries are
required.