Avoid changing directories during rehash process
Speed up rehash process when there are many Ruby versions

On my system that has 25 versions under rbenv, this speeds up rehash
almost 3-fold:

- before: 391 ms
- after:  134 ms

This is achieved by removing duplicate names of executables before
registering them as shims. Since most Rubies will share a lot of the
same executable names ("ruby", "rake", "bundle", ...), this is a
considerable reduction in number of shims registered.
Simplify the shims registration implementation in `rbenv-rehash`

It doesn't need to be a bash array and we don't need a separate index of
shims registered. Simply keep everything in a space-separated string and
use that as an index as well.

This assumes that executable names *never* have spaces in them.
Merge pull request #636 from sstephenson/speedup-rehash

Speed up `rbenv rehash`