Sorting IDs to remove filesystem dependency.

Added back in deleted test.