Reduce sorting in SpecFetcher#tuples_for

When fetching tuples for a source the #tuples_for method would first
look in the cache of types and sources, then sort the result.  This
meant that the sort would be performed each time the tuples were
fetched which could take some time.

Now the tuples are sorted before being placed in the cache so subsequent
fetches do not need to repeat the expensive sorting.

This significantly speeds up the outdated command, probably the update
command too.

See #657