Move all upgrade routines into the command-line tool.