large refactoring: model.dir now return a dir object; Disk now set in outer context only