updates to live upgrade script
tests, cleanup and minor improvements