Bring rbenv-gem-rehash functionality to core

/cc @sstephenson for review. Should we maybe instead of `rbenv.d/` have `etc/rbenv.d/`, like we expect from rbenv plugins?

:construction: needs tests :construction: 

Fixes #384