Added a bunch of functionality to emacs