core.sh: Added pre_ and post_ for upgrade and remove