Rewrite using R6, implement file data store