Convert file reading functions to use Node.js fs