Clean up & unify upgrade scripts

- Remove all unversioned upgrade steps
- Strictly compare versions as strings, fix regexps
- Unify variables across upgrade scripts