Sort bundles as they are collected.

We need to traverse the dependency hierarchy in order to construct the set
of bundles, therefore the set can be sorted as it is built.
Increment build number.