Turn lambdas into defuns

http://ergoemacs.org/emacs/emacs_avoid_lambda_in_hook.html