Add a new memorybuffer class, to unify all the file reading code in the system