Abstract all file-system operations
Stage 1 of  #62