Chrome FileSystem API wrapper using promise and defer