Added teardown and upgrade scripts. Reworked evaluation of environment properties so that they can now be passed on during creation of application and/or cartridge.