Moved some file-related methods to file_utils

There are some more things that should be extracted to there