Move file functions to filetools directory