Move file system handling to fs.sh