Added a few emacs lisp function - editted others
Changes for OSX compatibility