Big refactor of the file, making things more functional by registering hooks. Additionally organized the global emacs configs up top and package specific changes down below