Improved and refactored postdeploy and shutdown_container scripts.