A huge refactoring

 Emacs Prelude is too awesome not to steal code from it!