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.