Clean up a few errors and get rid of references to .emacs.d

This also makes the code work with emacs 24.3, though
I'm not sure i've made it backwards compatbile