Fix hooks

This pull request is combination of #3006 and #3008 

The `after_cd` and `after_use` should be fixed so there is no reason to have separate merge requests. 

Note: It contains changes in `scripts/rvm` which are different from the changes proposed in #3006.

The summarised behaviour is:

* when rvm is loading first time the `after_cd` hooks should be triggered.
* whenever a user uses the cd command `after_cd` should be triggered
* whenever rvm changes the environment  `after_use` hooks should be triggered.
loading default is required for proper work of rvm:

1. load default ruby always (when no project files)
2. load default ruby to be used as base for `rvm use @gemset` in `.rvmrc` in main project dir

the first case is required and the second one is rarely used but it is still used as I got reports of it quite recently