Es5 read file

I forgot the actual ES5 rewriting PR.

I also fixed a typo in `close`