Use graceful-fs, add maxOpen config, refactor a few things