Add replace_word_in_file function to file module