Add functions borrowed from Jim Weirich emacs setup.

Mostly code copied straight from the link at the top of the file. However changed the keybindings and switched to `enh-ruby-mode` instead of plain `ruby-mode`