Fixup readFile

 - fixed output related typos
 - added close function
 - rewrote to ES5 + generators

You forgot the `close` function and left a few typos.

I also ported this to ES5 just like the other one.