fix various minor bugs
add emacs configuration, depends on https://github.com/bbatsov/prelude