Made ReadFile more stable/less panicky

Also added documentation. :-)

I haven't tried it (just edited in my browser) but it should work