Much better handling of upgrade situations, and general streamlining.
(Cherry picked from !81 (merged))