Moved sort into its own package