The first commit adds CBufferedFile, which works like CAutoFile, but buffers the data in memory, so it is rewindable, and supports fast scanning inside the buffer.
The second commits switches LoadExternalBlocksFromFile to use CBufferedFile, simplifying it, and removing all fseek()'s.