File system implementation
Rewrite since Promise API changed