Changed readFileSync to return string instead of buffer as originally intended.
Fixed encoding.
Changed to Buffer as the encoding didn't work properly.