changes to load_txt, and added other file util functions