Refactor basher init.
Add shell detection to init.

The shell detection was copied from rbenv.

It should be easy to implement issue #1 now, by switching on the $shell
variable.