core.sh: echoerr, pre and post install

* echoerr: redirect to stderr
* pre_install and post_install
* Handling update of a package