Please use `${RBENV_ROOT}/shims` as `$PATH` of build environment

Please use `${RBENV_ROOT}/shims` as `$PATH` of build environment. Rehashing after `gem install` makes all shims available. I think this usage is the standard way in rbenv.

Plus, I modified around path handling. This patch will also fixes #1.

The summary of changes:

1. Use `${RBENV_ROOT}/shims` as `$PATH`.
2. Run `rbenv rehash` properly after `gem install` to update binstubs.
3. Respect `${RBENV_ROOT}` if it has been defined in shell (#1)
4. Escape command line arguments for safety
5. Added `run` and `capture` methods