Rewrite readAll to use less memory so it copes with larger files better