Reduce memory consumption when opening big files.

Yi tries to guess filetype by looking at file contents in String form,
that means an order of magnitude memory overhead. This commit changes
this behavior to looking just at first 1K of file contents.
Actually fix #499.

This time around I don't break movement or Vim searches. I also
replicate emacs behaviour for pressing return.