Further refined approach to upgrade.

- If intermediary structure does not fit in RAM, fall back
  to a multi-pass approach.
- Make upgrade mostly GC free.