pre-upgrade and shell scripts

* `--pre-upgrade` scripts now run as shell scripts and are no longer required (breaking api)
* fixed tests to use scripts instead
* rewrote tests to not use `setTimeout()`